Heres my directory tree:
/cgi-bin
-/carts
-/Temp_ORDERS
this_script.cgi
this_script:
$directory = 'carts';
opendir(DELE, $directory) or die "Can't Open directory";
@TODELETE = readdir(DELE);
chdir($directory) or die "Can't Change directory";
foreach $file (@TODELETE) {
if (-d $file) {next};
if ((-C $file) > 1) {
unlink($file);
}
}
closedir(DELE);
$directory = '../Temp_ORDERS';
opendir(DELE, $directory) or die "Can't Open directory";
@TODELETE = readdir(DELE);
chdir($directory) or die "Can't Change directory";
foreach $file (@TODELETE) {
if (-d $file) {next};
if ((-C $file) > 1) {
unlink($file);
}
}
closedir(DELE);
chdir('../../cgi-bin');
Doesn't delete anything! .. i want it delete when files in each directory are over 1 day old ..
any help?
/cgi-bin
-/carts
-/Temp_ORDERS
this_script.cgi
this_script:
$directory = 'carts';
opendir(DELE, $directory) or die "Can't Open directory";
@TODELETE = readdir(DELE);
chdir($directory) or die "Can't Change directory";
foreach $file (@TODELETE) {
if (-d $file) {next};
if ((-C $file) > 1) {
unlink($file);
}
}
closedir(DELE);
$directory = '../Temp_ORDERS';
opendir(DELE, $directory) or die "Can't Open directory";
@TODELETE = readdir(DELE);
chdir($directory) or die "Can't Change directory";
foreach $file (@TODELETE) {
if (-d $file) {next};
if ((-C $file) > 1) {
unlink($file);
}
}
closedir(DELE);
chdir('../../cgi-bin');
Doesn't delete anything! .. i want it delete when files in each directory are over 1 day old ..
any help?