Re: [Perl-unix-users] How to determine if a directory is empty

2002-10-01 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote: > Hi, > > I want to determine if a directory is empty and delete it. > I have tried > if ( -d $dd && -z $dd) > but that doesn't seem to work. Does -z work > only with plain files? > > Should I read the directory and if it contains only . and .., determine > that > is

[Perl-unix-users] How to determine if a directory is empty

2002-09-30 Thread Tassos123
Hi, I want to determine if a directory is empty and delete it. I have tried   if ( -d $dd && -z $dd) but that doesn't seem to work. Does -z work only with plain files? Should I read the directory and if it contains only . and .., determine that is empty? It must be an easier way than that. Any