Sibi John wrote:
>
> hi,
>
> the script that which i have put below is made with the help of several of
> u guys on the list. The script is intended to check access dates on the
> files and
> return them with the owner of the files . For some reason after i added the
> perms module from Roth , it suddenly started to change the access dates..
> now even after commenting the the perms module.. any ideas or hints..
I can't test this on 98SE, but give it a try:
use strict;
use File::Find;
use FileHandle;
use Win32::Perms;
print "Enter No. of days: ";
my $diff = <STDIN>;
my $prior_date = time - 86400 * $diff;
get_time();
open FD, ">C:\\sibifire.txt" or die "Cannot open output file: $!\n";
print FD "Here is an output line.\n";
find (\&wanted, 'c:/');
close FD;
sub wanted {
return if -d $_; # skip dirs
my $atime = (stat $_)[8]; # get last access time
return if ($atime > $prior_date); # return if newer than the date we want
my ($sec, $min, $hour, $mday, $mon, $year) = (localtime $atime)[0..5];
my $MyAccessDate = sprintf "%02d/%02d/%02d-%02d:%02d:%02d", ++$mon, $mday,
($year % 100), $hour, $min, $sec;
my $perms = new Win32::Perms($File::Find::name);
print FD join ('@', $File::Find::name, $MyAccessDate, $perms->Owner()), "\n";
print join ('@', $File::Find::name, $MyAccessDate, $perms->Owner()), "\n";
}
__END__
--
,-/- __ _ _ $Bill Luebkert ICQ=14439852
(_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED]
/ ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_ Castle of Medieval Myth & Magic http://www.todbe.com/
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin