find2perl /mydir -type f -newer lasttime -print > find-recent-files.pl
gets you some perl that is close to what you want, and you can change the strings '/mydir' and 'lasttime' to command line input.
#! /opt/local/bin/perl -w eval 'exec /opt/local/bin/perl -S $0 ${1+"$@"}' if 0; #$running_under_some_shell use strict; use File::Find (); use vars qw/*name *dir *prune/; *name = *File::Find::name; *dir = *File::Find::dir; *prune = *File::Find::prune; sub wanted; my $timefile = shift; my $rootdir = shift; (-e "$timefile") or die "$0 : last mod time file \"$timefile\" does no +t exist\n"; (-d "$rootdir") or die "$0 : directory \"$rootdir\" for search does no +t exist\n"; my $AGE_OFlasttime = -M "$timefile"; # Traverse desired filesystems File::Find::find({wanted => \&wanted}, "$rootdir"); exit; sub wanted { my ($dev,$ino,$mode,$nlink,$uid,$gid); (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && -f _ && (-M _ < $AGE_OFlasttime) && print("$name\n"); }
In reply to Re: Checking for files changed
by dwhite20899
in thread Checking for files changed
by richill
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |