Hello Chris,
Tuesday, June 26, 2001, Porter, Chris <[EMAIL PROTECTED]> wrote:
PC> It's me again, still won't work. Here is the whole script:
PC> Again, any help would be great.
Well, script works correct now.
May be you try to rmdir not empty subdirs?
c:\>perldoc -f rmdir
rmdir FILENAME
rmdir Deletes the directory specified by FILENAME if that
directory is empty. If it succeeds it returns TRUE,
otherwise it returns FALSE and sets `$!' (errno). If
FILENAME is omitted, uses `$_'.
you can avoid many troubles, if you check return codes, like this:
rmdir $Name or die $!;
PC> chdir "/u131/tmp" or die $!;
PC> opendir(HERE, '.');
PC> @AllFiles = readdir(HERE);
PC> foreach $Name (@AllFiles) {
PC> if (-f $Name) {next}
PC> if ((-d $Name) and ($Name =~ /^[A-Z]+$/)) {rmdir $Name}
PC> if ((-d $Name)) {print "$Name\n"}
PC> }
Best wishes,
Maxim mailto:[EMAIL PROTECTED]