Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Reset the time after a readdir

by Anonymous Monk
on Oct 21, 2014 at 23:28 UTC ( [id://1104617]=note: print w/replies, xml ) Need Help??


in reply to Reset the time after a readdir

...

reset the time? Is "the time" a variable of some sort? What is the name of this variable?

Have you tried writing a program that loops, prints "the times", then every once in a while makes a file "newer", so that you can see how/if the time is changed?

I think you'll be better off to use time and stat and avoid reset

Replies are listed 'Best First'.
Re^2: Reset the time after a readdir
by Anonymous Monk on Oct 21, 2014 at 23:44 UTC

    So maybe

    Or

    #!/usr/local/bin/perl -- ## theTimeDifferCopier.pl ## 2014-10-21-16:50:47 ## ## ## ## ## ## perltidy -olq -csc -csci=3 -cscl="sub : BEGIN END " -otr -opr -ce +-nibc -i=4 -pt=0 "-nsak=*" ## perltidy -olq -csc -csci=10 -cscl="sub : BEGIN END if " -otr -opr +-ce -nibc -i=4 -pt=0 "-nsak=*" ## perltidy -olq -csc -csci=10 -cscl="sub : BEGIN END if while " -otr + -opr -ce -nibc -i=4 -pt=0 "-nsak=*" #!/usr/bin/perl -- use strict; use warnings; use Path::Tiny qw/ path /; Main( @ARGV ); exit( 0 ); sub Main { my $basetime = $^T; my $lasttime = $basetime; while( 1 ) { my @files = path( $dir )->children( qr/$filterPattern/ ); for my $file ( @files ) { my $mtime = $file->stat->mtime; my $diffSeconds = $mtime - $lasttime; if( $diffSeconds < 30 ) { print "## $file is so new its $diffSeconds old\n"; } } sleep 1; $lasttime = time; } } ## end sub Main

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found