use File::Find; @ARGV = 'c:\temp'; $filesize=-1; $filename=''; find(\&test, @ARGV); # to get the biggest file size in a directory sub test { if (-f && -s _ > $filesize) { $filesize = -s _; $filename = $File::Find::name; } } print "\nBiggest file"; print "\n============"; print "\n$filename in @ARGV is $filesize bytes long.\n\n\n"; find(\&test1, @ARGV); # to get the Modify Date and Time in a directory print "\nModify Date"; print "\n============\n"; my ($mtime, $fname); sub test1 { $mtime = (stat(_))[9]; $fname = $File::Find::name; print "$fname " . scalar(localtime($mtime)) . "\n"; }
In reply to Re: Watching large numbers of files for modifications?
by gopalr
in thread Watching large numbers of files for modifications?
by BUU
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |