question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Get-ChildItem will recurse indefinititely for recursive symlinks

See original GitHub issue

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


Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
SteveL-MSFTcommented, Jun 8, 2017

@mklement0 the only way to determine if there is a good chance that something will be implemented is that it’s assigned to someone. for the 6.0.0 release anything with a 6.0.0-highpriority means we’ve triaged it and believe it’s a must have before we can declare a 6.0.0 release candidate, the other 6.0.0-* milestones are ones we use internally for triage purposes and don’t imply will be fixed. if there’s any issue you believe is must have for 6.0.0 (rather than a release after 6.0.0), call my attention to it (also good to include @joeyaiello). thanks!

2reactions
jeffbicommented, Jun 7, 2017

I’m happy to continue working on this once the desired behavior is defined, including the mechanism for opting in.

Read more comments on GitHub >

github_iconTop Results From Across the Web

List all files and dirs without recursion with junctions
But here is a simple one for listing all files recursively without junction ... The symbolic link will be an icon in Windows...
Read more >
How to make Get-ChildItem not to follow links
-FollowSymlink By default, the Get-ChildItem cmdlet displays symbolic links to directories found during recursion, but doesn't recurse into ...
Read more >
Symbolic link recursion - what makes it "reset"?
It is an attribute of the process which is a handle to a file of type directory where relative paths (in system calls...
Read more >
File explorer keeps recursively searching into symlinks
File explorer keeps recursively searching into symlinks. Recently some folder permissions on my Windows 10 laptop were messed up, ...
Read more >
Recursively List All Files in a Directory Including Symlinks
In this short tutorial, we'll see how to follow symlinks when listing recursively all files in a directory. To do that, we can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found