Front page | perl.perl5.porters |
Postings from November 2003
[perl #24418] Directory traversal order of File::Find different in 5.8.0
From:
Darren Dunham
Date:
November 4, 2003 22:00
Subject:
[perl #24418] Directory traversal order of File::Find different in 5.8.0
Message ID:
rt-24418-67076.6.92657756651521@rt.perl.org
# New Ticket Created by Darren Dunham
# Please include the string: [perl #24418]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=24418 >
This is a bug report for perl from dunhamd@pacbell.net,
generated with the help of perlbug 1.34 running under perl v5.8.0.
-----------------------------------------------------------------
[Please enter your report here]
Apologies if this is seen twice. I did not receive any acknowlegement
of the previous mail as I have with past bug reports.
This came up on comp.unix.solaris about replacing a 'find' call with a
perl program running File::Find. Under 5.8.0, it appears that the
traversal order of subdirectories is not the same as that of 5.005_03
or the /bin/find program. The latter two appear to use directory
order, 5.8.0 appears to reverse that.
This doesn't directly break anything I'm aware of, but it's not at all
what I expect. If possible, I would imagine it should be done in
directory traversal order.
$ ls -l
total 4
drwxr-xr-x 2 add other 512 Nov 2 23:10 a/
drwxr-xr-x 2 add other 512 Nov 2 23:10 b/
$ ls -f1
.
..
a
b
$ truss find . 2>&1 | grep chdir
chdir("./") = 0
chdir("a/") = 0
chdir("..") = 0
chdir("b/") = 0
chdir("..") = 0
chdir("/server2/home/add/tmp2") = 0
$ truss perl -MFile::Find -e 'sub w {print $File::Find::name, "\n";} find(\&w, ".")' 2>&1 | grep chdir
chdir(".") = 0
fchdir(3) = 0
chdir("b") = 0
chdir("..") = 0
chdir("a") = 0
chdir("/server2/home/add/tmp2") = 0
$ truss /usr/bin/perl -MFile::Find -e 'sub w {print $File::Find::name, "\n";} find(\&w, ".")' 2>&1 | grep chdir
chdir(".") = 0
chdir("a") = 0
chdir("..") = 0
chdir("b") = 0
chdir("..") = 0
chdir("/server2/home/add/tmp2") = 0
/usr/bin/perl is version 5.005_03 built for i86pc-solaris (stock Sun
version included in Solaris 8). 'perl' is v5.8.0 built for
i86pc-solaris (and invoking this perlbug).
[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=library
severity=medium
---
Site configuration information for perl v5.8.0:
Configured by add at Fri May 2 23:46:37 PDT 2003.
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
Platform:
osname=solaris, osvers=2.8, archname=i86pc-solaris
uname='sunos tracon 5.8 generic_108529-19 i86pc i386 i86pc '
config_args='-Ui_db'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O',
cppflags='-fno-strict-aliasing'
ccversion='', gccversion='2.95.3 20010315 (release)', gccosandvers='solaris2.8'
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' '
libpth=/usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldl -lm -lc
perllibs=-lsocket -lnsl -ldl -lm -lc
libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-fPIC', lddlflags='-G'
Locally applied patches:
---
@INC for perl v5.8.0:
/server2/home/add/lib/perl5
/usr/site/perl-5.8.0/lib/i86pc-solaris
/usr/site/perl-5.8.0/lib
/usr/site/perl-5.8.0/lib/site_perl/i86pc-solaris
/usr/site/perl-5.8.0/lib/site_perl
/usr/site/perl-5.8.0/lib/site_perl
.
---
Environment for perl v5.8.0:
HOME=/server2/home/add
LANG (unset)
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/server2/home/add/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/site/openssh-3.6.1-p1/bin:/usr/sbin:/usr/ccs/bin:/usr/dt/bin
PERL5LIB=/server2/home/add/lib/perl5
PERL_BADLANG (unset)
SHELL=/bin/tcsh
--
Darren Dunham ddunham@taos.com
Unix System Administrator Taos - The SysAdmin Company
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >
-
[perl #24418] Directory traversal order of File::Find different in 5.8.0
by Darren Dunham