bengmau has asked for the wisdom of the Perl Monks concerning the following question:
foreach (<SERVERLIST>) { my $servername=$_; chomp($servername); if (!($servername=~/^#/)&& ($servername)) {## no #'s and not empty do this my $pathtocache='//'.$servername.'/'.'e$'; opendir(DIR, $pathtocache); my(@files) = grep {/^VSPCache/i } readdir(DIR); ## give m +e a list of only VSPCache files closedir(DIR); ## close directory handler foreach (@files) { my $filename=$_; my $file2del=$pathtocache.'/'.$filename; my $unlinkstat=unlink($file2del); if ($unlinkstat==0) { ## add unsuccessful delete to error array list to be + sent out later push @errlist, $file2del."\n"; } } } } close(SERVERLIST);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: unlink return code success but not deleted
by Abigail-II (Bishop) on Feb 25, 2004 at 15:07 UTC | |
|
Re: unlink return code success but not deleted
by rinceWind (Monsignor) on Feb 25, 2004 at 16:10 UTC | |
|
Re: unlink return code success but not deleted
by ysth (Canon) on Feb 25, 2004 at 16:29 UTC | |
|
Re: unlink return code success but not deleted
by bengmau (Beadle) on Feb 25, 2004 at 15:00 UTC |