Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Recent file

by sathiya.sw (Monk)
on Mar 05, 2009 at 13:24 UTC ( [id://748521]=note: print w/replies, xml ) Need Help??


in reply to Recent file

what did you mean by recent file ?
Some body can say files which are created b/w 1s and 10 sec is recent file.
Some body can say files which are created after the file named foo is recent file.
So according to it you can get the solution.
You can use the file::find.
Use the find2perl for generating code as
Find files which are created after FOO.
find2perl find -newer foo
#! /usr/bin/perl -w eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' if 0; #$running_under_some_shell use strict; use File::Find (); # Set the variable $File::Find::dont_use_nlink if you're using AFS, # since AFS cheats. # for the convenience of &wanted calls, including -eval statements: use vars qw/*name *dir *prune/; *name = *File::Find::name; *dir = *File::Find::dir; *prune = *File::Find::prune; sub wanted; my $AGE_OFfoo = -M 'foo'; # Traverse desired filesystems File::Find::find({wanted => \&wanted}, 'find'); exit; sub wanted { my ($dev,$ino,$mode,$nlink,$uid,$gid); (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && (-M _ < $AGE_OFfoo) && print("$name\n"); }
Sathiyamoorthy

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-25 09:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found