List of directories within a directory
- From: Al Moodie <nospam@xxxxxxxxxx>
- Date: Tue, 29 Jan 2008 21:00:27 -0500
I have a directory with 200 sub directories in it. How do I create a
list of the sub directory names?
I know how create a list of all the files in a directory:
opendir(DIR, $dirname) or die "can't open $dirname: $!";
while (defined($file = readdir(DIR))) {
next if($file =~ m/^\./);
next if($file eq "");
push (@filenames, $file);
}
closedir(DIR);
but how do I do it for the directories within a directory
Al Moodie.
.
- Follow-Ups:
- Re: List of directories within a directory
- From: Jürgen Exner
- Re: List of directories within a directory
- From: John W. Krahn
- Re: List of directories within a directory
- From: Ben Morrow
- Re: List of directories within a directory
- Prev by Date: ssh into remote nodes, do mulitple commands
- Next by Date: FAQ 8.40 How do I avoid zombies on a Unix system?
- Previous by thread: ssh into remote nodes, do mulitple commands
- Next by thread: Re: List of directories within a directory
- Index(es):