develooper Front page | perl.perl5.porters | Postings from September 2000

File::Find feature request

Thread Next
From:
Rich Morin
Date:
September 13, 2000 19:38
Subject:
File::Find feature request
Message ID:
v0422089cb5e5e1ef96f9@w205.z205158144.scl-ca.dsl.cnc.net
I would like find (and perhaps finddepth) in File::Find to
walk directories in sorted, rather than "accidental" order.

It looks to me as if this could be accomplished by changing
two lines of code (one in each routine), as follows:

     my(@filenames) = readdir(DIR);
---
     my(@filenames) = sort(readdir(DIR));

I think that the performance hit would be negligible in most
cases and that the benefit (trees get walked in a "reasonable"
order) would be worth the cost.  If the Powers That Be don't
agree, however, I suppose alternative versions (sfind[depth]?)
could be tacked into the module.

Side Note:  I went to "The Perl 5 Module List" to find out who
is in charge of File::Find.  The "Info" link reads "P5P", but
its use results in an error: "CPAN id 'P5P' not found".  Tsk.

-r
--
Rich Morin:          rdm@cfcl.com, +1 650-873-7841, http://www.cfcl.com/rdm
Prime Time Freeware: info@ptf.com, +1 408-433-9662, http://www.ptf.com
MacPerl: http://www.macperl.com, http://www.ptf.com/ptf/products/MPPE
MkLinux: http://www.mklinux.org, http://www.ptf.com/ptf/products/MKLP

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About