A
Arvin Portlock
I'm trying to use File::Find::Rule to get files modified in
the last 24 hours. With the help of find2perl I got a plain
File::Find to work just fine, but File::Find is pretty horrible
so I'd prefer File::Find::Rule. This is on a Windows 2000
system:
My working File::Find version:
use File::Find;
my $rootdir = 'D:/MYDOCU~1/schema_validate';
File::Find::find({wanted => \&since_yesterday}, $rootdir);
sub since_yesterday {
my ($dev,$ino,$mode,$nlink,$uid,$gid);
(($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
(int(-M _) < 1)
&& print("$File::Find::name\n");
}
My not-working File::Find::Rule version:
use File::Find::Rule;
my $rootdir = 'D:/MYDOCU~1/schema_validate';
my @files = File::Find::Rule->file()
->name( '*.pl' )
->mtime ("-1")
->in($rootdir);
foreach my $file (@files) {
print "$file\n";
}
I've actually tried a variety of things for the mtime() method
but either get nothing or I get everything. It's not clear to
me how to apply mtime() here.
Arvin
the last 24 hours. With the help of find2perl I got a plain
File::Find to work just fine, but File::Find is pretty horrible
so I'd prefer File::Find::Rule. This is on a Windows 2000
system:
My working File::Find version:
use File::Find;
my $rootdir = 'D:/MYDOCU~1/schema_validate';
File::Find::find({wanted => \&since_yesterday}, $rootdir);
sub since_yesterday {
my ($dev,$ino,$mode,$nlink,$uid,$gid);
(($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
(int(-M _) < 1)
&& print("$File::Find::name\n");
}
My not-working File::Find::Rule version:
use File::Find::Rule;
my $rootdir = 'D:/MYDOCU~1/schema_validate';
my @files = File::Find::Rule->file()
->name( '*.pl' )
->mtime ("-1")
->in($rootdir);
foreach my $file (@files) {
print "$file\n";
}
I've actually tried a variety of things for the mtime() method
but either get nothing or I get everything. It's not clear to
me how to apply mtime() here.
Arvin