Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: get directory listing

by pg (Canon)
on Nov 08, 2005 at 07:09 UTC ( #506629=note: print w/ replies, xml ) Need Help??


in reply to get directory listing

Use -d to determine whether it is a directory. By the way, don't chop(), but chomp() if it is needed. The following code was tested on Windows XP, don't have UNIX access handy:

opendir(DIRHANDLE,"c:/") || die "file to open"; for my $file (readdir DIRHANDLE) { print "$file\n" if (-d "c:/$file"); } closedir(DIRHANDLE);


Comment on Re: get directory listing
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2015-07-28 06:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (252 votes), past polls