Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Get file names between two timestamps on Unix/Linux

by perlCrazy (Monk)
on Dec 27, 2007 at 05:47 UTC ( #659154=perlquestion: print w/ replies, xml ) Need Help??
perlCrazy has asked for the wisdom of the Perl Monks concerning the following question:

Want to develop a application which will provide a list of files between two timestamps and have the ability to view the same via web.
one option is to use find command but trying to avoid this, is there any better way to accomplish this in perl?
Any suggestions will be great help.
Thanks

Comment on Get file names between two timestamps on Unix/Linux
Re: Get file names between two timestamps on Unix/Linux
by GrandFather (Cardinal) on Dec 27, 2007 at 07:07 UTC

    It may be that File::Find::Rule's mtime or ctime will get you where you want to go. Something like (untested):

    my @files = File::Find::Rule->file () ->name ('*.pl') ->ctime(">=$startTime") ->ctime("<$endTime") ->in (@INC);

    Perl is environmentally friendly - it saves trees
Re: Get file names between two timestamps on Unix/Linux
by HeatSeekerCannibal (Beadle) on Dec 28, 2007 at 16:15 UTC
    You could also go the very long way and use the opendir and stat functions. You would learn more, but the File::Find module its definitely easier.

    Best of luck!

    Heatseeker Cannibal

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2014-08-23 06:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (172 votes), past polls