in reply to Too many files
One way is to simply test for them:
If you can safely ignore any files that begin with a dot, consider using glob() with a star:opendir(D, "/some/directory"); my @entries = readdir(D); closedir(D); for my $f (@entries) { next if ($f eq "." or $f eq ".."); ... }
A third way is to skip all entries that are not files:my @entries = glob("/some/directory/*"); ...
opendir(D, "/some/dir"); my @entries = readdir(D); closedir(D); for my $f (@entries) { next unless -f "/some/dir/$f"; ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Too many files
by ikegami (Patriarch) on Jun 03, 2008 at 20:07 UTC | |
|
Re^2: Too many files
by nessundorma (Initiate) on Jun 03, 2008 at 16:30 UTC |