Thanks,

I found out, that I need to add the full path
to the file $directoryempty = $searchdrive1 . $directoryempty;

regards,

John

-----Original Message-----
From: Jason shaw [mailto:[EMAIL PROTECTED]
Sent: Friday, September 26, 2003 11:48 AM
To: [EMAIL PROTECTED]
Subject: Re: removing an empty directory


Maybe it's the fact that you're trying to deleted it while you still have it
open (open as in "opendir()"). Try doing a closedir() before deleting it.

>>> John Deretich <[EMAIL PROTECTED]> 09/26/03 01:55PM >>>
Hello,

I was wondering if anyone would know
why rmdir wouldn't remove an empty directory?

This is the code that I'm using:

use strict;

my $directoryempty = undef;
my $searchdrive1 = 'I:\\';

opendir(EMPTYDIR, $searchdrive1) ;
       while($directoryempty  = readdir(EMPTYDIR) ) {
           chomp $directoryempty;
           rmdir ("$directoryempty") || warn "Cannot remove directory
$directoryempty\n";
         }

thanks,

John
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED] 
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to