| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Brings the cmdlet more in line with the Unix "ls -r" and the Windows "DIR /S" commands. Like the Unix "ls" command, the cmdlet will recurse into symlinks given on the command line, but not into symlinks found during recursion.
|
jeffbi Could you please expand "Brings the cmdlet more in line with the Unix ls -r and the Windows DIR /S commands" for future docs (describe a behavior of the native commands)? |
Sorry, something went wrong.
|
Ilya (@iSazonov) Updated the description. |
Sorry, something went wrong.
| { | ||
| Dir(recursiveDirectory, recurse, depth - 1, nameOnly, returnContainers); | ||
| bool hidden = false; | ||
| if (!Force) hidden = (recursiveDirectory.Attributes & FileAttributes.Hidden) != 0; |
There was a problem hiding this comment.
Please use pattern:
if ( ... )
{
...
}
Sorry, something went wrong.
There was a problem hiding this comment.
Ilya (@iSazonov) This all-on-one-line pattern, which I don't like either, is used in a couple of places in the code. Shall I change them all?
Sorry, something went wrong.
There was a problem hiding this comment.
General rule - do not make changes that do not belong to the main remedy in order not to complicate the review.
But maintainers may request/allow to correct bad patterns.
Sorry, something went wrong.
There was a problem hiding this comment.
Got it, thanks.
Fixed
Sorry, something went wrong.
|
jeffbi Thanks for the good fix! LGTM. |
Sorry, something went wrong.
| // if "Hidden" is explicitly specified anywhere in the attribute filter, then override | ||
| // default hidden attribute filter. | ||
| if (Force || !hidden || isFilterHiddenSpecified || isSwitchFilterHiddenSpecified) | ||
| if (!InternalSymbolicLinkLinkCodeMethods.IsReparsePoint(recursiveDirectory)) |
There was a problem hiding this comment.
jeffbi Could you please summarize the description and add it as comments right before this statement? I hope the comment can explain why we are checking IsReparsePoint on recursiveDirectory and what behavior of Get-ChildItem we are trying to get by having this check. I'm sure the comments will be very helpful to other people when looking at this code.
Sorry, something went wrong.
There was a problem hiding this comment.
Comments added.
Sorry, something went wrong.
| $ci[1].Name | Should MatchExactly $filenamePattern | ||
| $ci[2].Name | Should MatchExactly $filenamePattern | ||
| } | ||
| It "Get-ChildItem does not recurse into symbolic links" { |
There was a problem hiding this comment.
This test case title is a little confusing because Get-ChildItem $alphaLink -Recurse works recursively as expected :)
Maybe the following is better?
Get-ChildItem does not recurse into symbolic links unless it's explicitly specified on command line
Sorry, something went wrong.
There was a problem hiding this comment.
Title changed.
Sorry, something went wrong.
Sorry, something went wrong.
|
Dongbo Wang (@daxian-dbw) Yes, this prevents the situation that drives #3761. |
Sorry, something went wrong.
|
Somehow the AppVeyor CI status is not reported back to Github, but the AppVeyor CI build was successful: |
Sorry, something went wrong.
|
I think we need the ability to opt in with respect to symlink recursion - please see #3951 |
Sorry, something went wrong.
Brings the Get-ChildItem more in line with the Unix ls -r and the Windows DIR /S native commands. Like these commands, the cmdlet will display symbolic links to directories found during recursion but will not recurse into them. Like the Unix ls command---and unlike the Windows DIR /S command--- the cmdlet will recurse into symlinks given on the command line.
| Back | FazBrowse Home | New Git URL |
Brings the Get-ChildItem more in line with the Unix ls -r and the Windows DIR /S native commands. Like these commands the cmdlet will display symbolic links to directories found during recursion but will not recurse into them.
Like the Unix ls command---and unlike the Windows DIR /S command--- the cmdlet will recurse into symlinks given on the command line.
This also will fix the underlying problem behind #3761.