Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Checking if file has been modified in last 7 days using stat [9]

by Tanktalus (Canon)
on Mar 17, 2005 at 23:47 UTC ( [id://440592]=note: print w/replies, xml ) Need Help??


in reply to Checking if file has been modified in last 7 days using stat [9]

In the spirit of TMTOWTDI ... and in the spirit of "How do I do X with Y", I present: "How do I do X ... with X?":

my @info = stat $tapes; print 'this file hasn't been modified in a while' if -M _ > 7;

The -M function was written specifically for this - as long as you have a short-running script. That's becasue -M compares the modification time to the time that your script started. If you have something running in a persistant environment (e.g., mod_perl), this is probably not what you want. Cron jobs, however, would be somewhere that this just makes things easier.

  • Comment on Re: Checking if file has been modified in last 7 days using stat [9]
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://440592]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2024-04-23 14:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found