Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Recursive directory listing

by Generoso (Parson)
on Sep 17, 2010 at 14:52 UTC ( #860502=note: print w/ replies, xml ) Need Help??


in reply to Recursive directory listing

You need to use a recursive function like the one below.

#!D:/Programs/PERL/bin/perl.exe -w use File::stat; my $dir = "D:/"; opendir(DIR, $dir) or die $!; while(defined (my $file = readdir(DIR))) { print "$file\n"; if(-d "$file") { print "directory found....\n"; opendir(newDIR, $file) or die $!; while(defined ($file = readdir(newDIR))) { print "got new file!!!!\n"; print "$file\n"; } closedir(newDIR); } } closedir(DIR);


Comment on Re: Recursive directory listing
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2015-08-02 19:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (10 votes), past polls