in reply to RE: Empty directory
in thread Empty directory
I put the -X test in there because the original poster mentioned looking for files. If the existence of a sub-directory is appropriate, you can leave it out.sub AreThereFiles { opendir DIR, "/path/to/nowhere" or die "That will linger: $!\n"; while (my $foo = readir DIR ) { chomp $foo; next if ( $foo =~ m/^\.\.?$/ ); next unless (-f $foo); closedir DIR; return 1; } closedir DIR; return 0; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: RE: Empty directory
by turnstep (Parson) on May 16, 2000 at 20:18 UTC |