Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: Searching directories

by softworkz (Monk)
on Sep 23, 2003 at 16:08 UTC ( #293554=note: print w/ replies, xml ) Need Help??


in reply to Re: Searching directories
in thread Searching directories

How about this way, tested on windoze 2000/Xp

use strict; use File::Find; use Win32::File; use Cwd; my $dir = cwd; my $attr; my $output ="dump.txt"; open(OUTPUT,">$output") || die "can't open $output: $!"; &File::Find::find(\&wanted,"$dir"); sub wanted{ print OUTPUT "Directory $_ \n" if(-d $_); -f $_ && (Win32::File::GetAttributes($_, $attr)) && print OUTPUT "File +\t\ $_\n"; } close(OUTPUT);


Comment on Re: Re: Searching directories
Download Code
Re: Re: Re: Searching directories
by Roger (Parson) on Sep 23, 2003 at 22:50 UTC
    Ah... but this approach took away the portability of the code with the use of the Win32 module. Unless of course you only want the script to run on a Windows box.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://293554]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2014-04-19 23:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls