Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How do I interpret mtime with stat()?

by Klem (Initiate)
on Dec 21, 2001 at 04:12 UTC ( [id://133671]=note: print w/replies, xml ) Need Help??


in reply to How do I interpret mtime with stat()?

If you don't need the other stuff that comes from stat(), you may want to consider using the -M file test operator, which yields the age (since 'last modified') for the file, in (fractional) days.

Replies are listed 'Best First'.
Re: Answer: How do I interpret mtime with stat()?
by Beatnik (Parson) on Dec 21, 2001 at 04:45 UTC
    Actually, it's the last modified for a file, from the moment the script started. If your script has been running for 48 hours (it could happen), then -M is totally off course. stat is in this case a much safer approach.

    Greetz
    Beatnik
    ... Quidquid perl dictum sit, altum viditur.
      Well, actually the filetest operators compute their deltas against the value of $^T, which is initialized during startup. However, you may reset it if you think it's value might be getting stale:
      $^T = time(); $age = -M $file;

      -Blake

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-03-19 02:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found