in reply to Re: Using -mtime in File::Find::Rule seems to fail on Windows
in thread Using -mtime in File::Find::Rule seems to fail on Windows

Of course I tried this before with the same effect. I tried '-1' because it's the way unix-find finds files modified between the last 24 hours. '1' means exactly 24 hours.
  • Comment on Re^2: Using -mtime in File::Find::Rule seems to fail on Windows

Replies are listed 'Best First'.
Re^3: Using -mtime in File::Find::Rule seems to fail on Windows
by BrowserUk (Patriarch) on Jul 20, 2004 at 14:10 UTC

    Sorry. I'm not a F::F::R user. However a quick look at the docs suggests that

    ->mtime( '<= 1 ' )

    should do the trick.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algoritm, algorithm on the code side." - tachyon
      I found an example at the Perl-Advent-Calendar. It uses unix-time in seconds. I've changed my script and it works fine now.
      #!/usr/bin/perl use strict; use warnings; use Data::Dumper; use Date::Calc qw/ Time_to_Date /; use File::Find::Rule; my $yesterday = time()-(1*24*60*60); print $last_week, "\n"; my @files = File::Find::Rule->file() ->name( '*.doc' ) ->mtime( ">$yesterday" ) ->in( 'D:/Dokumentation/' ); @files = map { { name => $_, #modified => [Time_to_Date((stat($_))[9])], size => (stat($_))[7] } } @files; print Dumper \@files;
      Thanks in advance, neniro