Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Get-ChildItem will recurse indefinititely for recursive symlinks #1875

Copy link
Copy link
@DHowett

Description

@DHowett
Issue body actions

Steps to reproduce

gci -r /sys

Expected behavior

gci reaches its terminus, and then ceases

Actual behavior

Because of these recursive symlinks,

PS /> ls -la /sys/bus/cpu/devices/cpu0/
lrwxrwxrwx.  1 root root    0 Aug 18 16:12 node0 -> ../../node/node0
PS /> ls -la /sys/bus/cpu/devices/cpu0/node0/
lrwxrwxrwx. 1 root root    0 Aug 18 16:12 cpu0 -> ../../cpu/cpu0

gci eventually runs into something like this:


    Directory: /sys/bus/cpu/devices/cpu0/node0/cpu0/node0/cpu0/node0/cpu0/node0/cpu0/node0/cpu0/node0/cpu0/node0/cpu0/nod
    e0/cpu0/node0/cpu0/node0/cpu0/node0/cpu0/node0/cpu0/node0/cpu0/node0/cpu0


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       08/18/2016     16:13                cache

It has shown no sign of stopping.

Linux's equivalent ls -lR /sys will cease, as it will not descend into already visited nodes.

Environment data

Name                           Value
----                           -----
PSVersion                      6.0.0-alpha
PSEdition                      Core
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   3.0.0.0
GitCommitId                    v6.0.0-alpha.9
CLRVersion
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issues

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.