I have a short and sweet perl script that I'm running directly on our TS server (Solaris 9 & TS 6.1) to delete some unwanted files off the docroot. Basically, I just build an array with a find command, then loop thru and unlink...problem is, the files aren't being deleted. Here's the code chunk and the error output:
my
@files = `find /teamsite/iwmnt/default/main/Development/WORKAREA/dsoderberg -type f -name "WS_FTP.LOG"`;
foreach $file (
@files){ ### Delete the WS_FTP.LOG file.
unlink $file or warn "Can't delete $file: $!\n";
print OUT "Deleted - " . $file . "\n";
} # end of foreach
Here's my error on the unlink:
Can't delete /teamsite/iwmnt/default/main/Development/WORKAREA/dsoderberg/deploy/docroot/wireless/WS_FTP.LOG
: No such file or directory
My confusion stems from the fact that the find is building the array and when it comes time to delete the file, all of the sudden, the file it found in the find command can't be found??? Has anyone run into anything like this?