in reply to RE: Re: Checking for Directories
in thread Checking for Directories
This version makes a single pass through the directory listing.
Of course, you may still not like this. It will be kinda hungry on memory, especially if the ratio of files to directories is very large - the foreach will suck in every file at once. It may be better to try it with a while loop - it will be easier on memory but will take longer due to buffering issues.#Assume all the open code foreach( readdir DH ) { next if ( $_ eq '.' or $_ eq '..' ); push @subdirs, "$dir/$_" if ( -d "$dir/$_" ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Checking for Directories
by chip (Curate) on Jul 29, 2000 at 00:30 UTC |