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..

 thanks..



use File::Find;
use FileHandle;
use Win32::Perms;
$| = 1;

print ("Enter No.of days :");
$diff =<STDIN>;

get_time();
open(FD, ">C:\\sibifire.txt") || "Cannot open file\n";

printf FD ("Here is an output line.\n");                                 
find(\&wanted, 'c:\');

close FD;  

sub wanted{
    return if ( /^\.{2}/ );
    return if ( /^\.{1}/ );
    return if -d $_;
    my @MyStat   = stat($_);
    return if ( $MyStat[8] > $DateDiff );
    my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime($MyStat[8]);
    $mon++;
    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" ;
    
 }
 
sub get_time {
    $diff = 86400 * $diff;
    ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time -
$diff);
    $mon++;
    $DateDiff = time;
    $DateDiff -= $diff;
    $diff = 0;
    
 }  # end of get_time
  <<access.pl>> 

access.pl

Reply via email to