-
Notifications
You must be signed in to change notification settings - Fork 822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File::Find does not search recursively in perl #910
Comments
Hi @Pyxzure This problem is caused by the file system that is in use by Ubuntu on Windows. The solution is to edit
Set
Now your example works! |
This should now be fixed in Insider builds. |
Not fixed in 14965, and over at #186 we're discussing a change to File::Find to resolve it. If WSL will be changed so that nlink works, work on changing File::Find should stop. |
@benhillis I'd love to see this working in the next public release. Can you confirm which insider build your fix will or should have landed on, so we can check whether it resolves the issue? |
@JasonLinMS is much more familiar with what is required here. Jason would you mind describing the issue? |
Thanks! From our discussion over at #186, it looks like the number of links in a directory is not as expected in a Linux environment. From the File::Find description:
Here's my test of this in build 14965 (*). Note the Links count always being 0.
(*) Because of the UUP work that started Friday the 2nd, I can't test on a newer build. Once Insider builds come to Fast ring again, I will test on the then-current build. |
I think I have to walk my statement back. Upon further testing, recursive File::Find appears to work, and I can install modules from cpan. |
Can you confirm that your intended fix was to set the link count to 0 on directories so that dont_use_nlink detection will trigger? The "nlink hack" in File::Find (and find(1), as I understand it) assumes that link count = subdirectories + 2, so if the link count is 0, that would make File::Find disable its nlink assumption automatically. I think. Working my way through this. If the outcome is "it is indeed fixed", that'd be swell! |
@yorickdowne - My understanding is that due to how NTFS is implemented there is no quick way to query this number (without doing an entire directory listing which would be very expensive from a performance perspective). @JasonLinMS can correct me if I'm wrong. |
@benhillis Setting it to 0 is completely acceptable, as it fixes the issue. Previously, the links value returned was "2" and that threw File::Find off. But with the value always being "0" for a directory, File::Find turns off its optimization and works recursively. |
@yorickdowne - glad to hear it. |
Thanks @benhillis , you are correct. |
@JasonLinMS, thank you for confirming. So that raises a question: If this "likely stays zero for the foreseeable future", do you recommend that the perl5 folk go ahead with the patch to File::Find that will detect they are inside WSL and go check for themselves, anyway? Likely doesn't mean definitely. |
@yorickdowne Sorry for the delayed response. We hope to avoid being special-cased as much as possible. For this particular issue, we will definitely keep the return value at zero until we can actually provide the correct value (which will not be any time soon). |
File::Find does not search recursively in perl
14393.51
build-essential
is installedThe text was updated successfully, but these errors were encountered: