Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When was a File Last accessed?

Status
Not open for further replies.
Aug 15, 2002
422
US
Regarding file test operators, can anyone tell me how I could check for a file that was accessed 10 minutes ago?

I was hoping to use:

if (-M $file > 0.0000010){
Do-What-I-Want;
}

Can anyone help me?

Thanks!
-pd
 
Code:
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
       $atime,$mtime,$ctime,$blksize,$blocks)
           = stat($filename);

#$atime = last access time in seconds since the epoch
---
cheers!
san
pipe.gif


"The universe has been expanding, and Perl's kind of been expanding along with the universe" - Larry Wall
 
Thank you san...

That is what I ended up doing... Kept getting an error though. Turned out that I was File::stat at the same time, which wasn't working...

Much Appreciated!
-pd

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top