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
Bug in File::Find on Windows when target dir is bare drive letter and no_chdir = 1 #8788
Comments
From johndporter@yahoo.comCreated by johndporter@yahoo.comBug in File::Find on Windows when target dir is bare drive letter and This bug is not elicited when the target (search) directory has any To demonstrate, make a directory named Windows somewhere on C: (or cd /d c:\ mkdir test\windows\foo cd test Now go to a different drive (pick one you have; it doesn't matter cd /d d:\ and execute the following Perl test script. Note that the target perl -MFile::Find -e "$\=$/; find( sub { print if -d }, 'c:' );" Output is just as you'd expect: . Now run the following, which is identical except that no_chdir is perl -MFile::Find -e "$\=$/; find({ no_chdir => 1, wanted => sub { You get erroneous output: . . . It appears that if find() finds, in the target directory, a Perl Info
|
From johndporter@yahoo.comCreated by johndporter@yahoo.comBug in File::Find on Windows when target dir is bare drive letter and no_chdir => 1 This bug is not elicited when the target (search) directory has any path info (i.e. slashes) in it, nor when no_chdir = 0 (the default). To demonstrate, make a directory named Windows somewhere on C: (or wherever your Windows installation is) OTHER THAN in the root directory (you wouldn't be able to anyway, since \Windows already exists), and put a small amount of known stuff in it, e.g. one subdirectory named foo. Make that directory (the one containing your fake Windows) the currently logged directory on that drive: cd /d c:\ mkdir test\windows\foo cd test Now go to a different drive (pick one you have; it doesn't matter which): cd /d d:\ and execute the following Perl test script. Note that the target directory is the bare drive C: with no path info (slashes): perl -MFile::Find -e "$\=$/; find( sub { print if -d }, 'c:' );" Output is just as you'd expect: . Now run the following, which is identical except that no_chdir is turned on: perl -MFile::Find -e "$\=$/; find({ no_chdir => 1, wanted => sub { print if -d } }, 'c:' );" You get erroneous output: . . . It appears that if find() finds, in the target directory, a subdirectory named X, it searches in C:\X, even though the target directory is not C:\. Perl Info
|
From p5p@spam.wizbit.beOn Tue Feb 20 09:39:44 2007, johndporter@yahoo.com wrote:
[...]
sub {
Patch attached. File::Find turned c: into c:/ (which is a completly different path). No tests for it added. (No idea how this can be tested automatically) Kind regards, Bram |
The RT System itself - Status changed from 'new' to 'open' |
p5p@spam.wizbit.be - Status changed from 'open' to 'resolved' |
From david@landgren.netBram via RT wrote:
Without looking at what you can recycle from the current test suite... Create a subdir on the current drive (might be D:, E: or other), You may need to skip if $^O ne 'Win32'. David |
From p5p@perl.wizbit.bePatch with test attached. (Original patch attached as well - since it has not yet been applied) Bram |
From @rgsLooks good to apply. (assuming the test pass on windows, but smokes 2008/5/12 Bram <p5p@perl.wizbit.be>:
-- |
From @rgs2008/5/12 Bram <p5p@perl.wizbit.be>:
Thanks, applied as #33911. |
Migrated from rt.perl.org#41555 (status was 'resolved')
Searchable as RT41555$
The text was updated successfully, but these errors were encountered: