Hi Maxim
Thanks so much for your help. Is this how the code should be before I test
it again.
---
use Cwd;
$log = 'c:\\temp\\chk_space.txt';
$path = 'dbm\\marketing_database_II';
open(LOG, ">>$log") or die "Can't open $log: $!";
print LOG "These files are over 60 days old and over 50MB\n\n";
ScanDir($path);
## why not &ScanDir($path)??
sub ScanDir
{
my ($workdir) = shift;
my ($start) = cwd;
my @stuff;
# my ($age, $size);
chdir($workdir) or die "Can't cd to $workdir: $!\n";
opendir(DIR, ".") or die "Can't open directory $path: $!\n";
@stuff = grep (!/^\.\.?$/ , readdir(DIR));
closedir(DIR);
foreach my $file (@stuff) {
# next if $file =~ /^\.\.?$/;
next if $file =~ /mediaCreate/;
if (-d $file) {
ScanDir($file);
next;
}
if(((-M $file) > 60) && ((-s $file) > 1024 ** 2 * 50 )) {
print LOG "$workdir/$file\n";
}
}
chdir($start) or die "Unable to CD to $start: $!\n";
}
close LOG;
--------
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]