in reply to Empty directory

You could try something like:
opendir (DH, "dir-name") or warn $!; @list = readdir (DH); closedir (DH);
Then check @list to see if any files are present.
Note Even in an empty directory you should find . and ..
Hope this helps.

Replies are listed 'Best First'.
RE: Re: Empty directory
by marcos (Scribe) on May 15, 2000 at 17:26 UTC
    If you want to check for files only you may do:
    opendir (DIR, $dir) or die "cannot opendir $dir"; my @only_files = grep {-f "$dir/$_"} readdir(DIR); closedir (DIR);
    marcos