You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original issue: PowerShell/PowerShell#10816.
It seems like the root cause is that string[] IO.Directory.GetFileSystemEntries() calls stat() on each entry to retrieve additional metadata, even though the only thing that method is requesting is the path, which should readily be available in the data provided by readdir().
This can be observed by running strace -f -tt -o trace.txt pwsh -noprofile -c '$a = [IO.Directory]::GetFileSystemEntries("/usr/bin")'
I quickly looked at the code and it seems like additional metadata should be retrieved lazily in FileSystemEntry.Unix.cs/FileStatus.Unix.cs (which is a reasonable thing to do), but I could be wrong. Is there something that is unexpectedly triggering stat()?