Thanks, I found out, that I need to add the full path to the file $directoryempty = $searchdrive1 . $directoryempty;
regards, John -----Original Message----- From: $Bill Luebkert [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 11:14 AM To: John Deretich Cc: Perl-Win32-Admin-Request (E-mail) Subject: Re: removing an empty directory John Deretich wrote: > 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"; Change the above line to: rmdir ($directoryempty) or die "rmdir $directoryempty: $!"; and find out -- ,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED] (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ -/-' /___/_<_</_</_ http://dbecoll.tripod.com/ (My Perl/Lakers stuff) _______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
