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);
In reply to unlink return code success but not deleted by bengmau
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |