Hi all,
I've written the following perl code to check if a temporary file is older than 0.01 days (about 15 minutes it works out) and if it is, to unlink/delete it.
I intend for this code to loop through all the files in a given directory, resulting in only the most recently created files are left.
Sample #1
foreach $drop_file (<files/*.*>) {
if( (-C $drop_file) >= 0.01 ) {
system("del $dropfile"
; }
}
}
Sample #2
foreach $drop_file (<files/*.*>) {
if( (-C $drop_file) >= 0.01 ) {
unlink($drop_file); }
}
}
I've tried both the system("del..."
and unlink methods, by neither seem to work...
Any thoughts?
I've written the following perl code to check if a temporary file is older than 0.01 days (about 15 minutes it works out) and if it is, to unlink/delete it.
I intend for this code to loop through all the files in a given directory, resulting in only the most recently created files are left.
Sample #1
foreach $drop_file (<files/*.*>) {
if( (-C $drop_file) >= 0.01 ) {
system("del $dropfile"
}
}
Sample #2
foreach $drop_file (<files/*.*>) {
if( (-C $drop_file) >= 0.01 ) {
unlink($drop_file); }
}
}
I've tried both the system("del..."
Any thoughts?