in reply to Re: run program until directory is not empty
in thread run program until directory is not empty
my $dir = "/var/tmp/monk"; chdir("$dir") or die "$!"; opendir(BIN, $dir) or die "Can't open $dir: $!"; #Read Directory readdir DIR; # reads . readdir DIR; # reads .. if (readdir DIR) { #now there should be a file or folder print "it's not empty"; } else { print "it is empty"; } close DIR;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: run program until directory is not empty
by onelesd (Pilgrim) on Jun 15, 2011 at 20:34 UTC |