Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Finding oldest file in directory

by bluto (Curate)
on Oct 18, 2004 at 19:25 UTC ( #400293=note: print w/ replies, xml ) Need Help??


in reply to Finding oldest file in directory

I wouldn't use the 'ctime' field (nor '-C' for that matter) since it's implementation varies depending on platform, and doesn't necessarily indicate age of a file's data -- just the file's metadata. You'll probably want to to use mtime (write time) or atime (access: most recent read or write) instead. See "perldoc perlport" and look for ctime.

I also wouldn't consider optimizing this much since any reasonable OS will cache your stats for you (and you only have a few files). These stats may even stay cached if you are reading them once a minute.


Comment on Re: Finding oldest file in directory

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2015-07-05 23:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (68 votes), past polls