Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: comparing 2 file time date stamps

by GrandFather (Saint)
on Nov 05, 2014 at 21:56 UTC ( #1106268=note: print w/replies, xml ) Need Help??


in reply to comparing 2 file time date stamps

In several replies you say "stamp of the file not in the staging directory". What do you mean by that?

Maybe you should write a little test app that shows the problem you have? Create two files. Wait a few seconds. Rewrite one of them, then perform your modify test. That way we can see and run the failing code and find a solution."

Perl is the programming world's equivalent of English

Replies are listed 'Best First'.
Re^2: comparing 2 file time date stamps
by craigt (Acolyte) on Nov 06, 2014 at 02:40 UTC
    GrandFather, please review the thread before yours by GotToBTru. I've posted 12 file set comparisons. In each pair, 1 file was in a base directory and the other was in a staging directory, really just a way of referring to the 2 locations. Please review.

      Run:

      use strict; use warnings; my $test1 = 'test1'; my $test2 = 'test2'; open my $fOut, '>', $test1; close $fOut; open $fOut, '>', $test2; close $fOut; print "$_: ", (stat $_)[9], "\n" for $test1, $test2; sleep 5; open $fOut, '>', $test2; close $fOut; print "$_: ", (stat $_)[9], "\n" for $test1, $test2;

      and tell us what you get.

      Perl is the programming world's equivalent of English
        GrandFather,

        Below are the results. Everything looks right. I am confused.

        I want to mention that I saw the following. I have a file with a dt stamp of 11/4 in dir 1. I make a copy of it expecting the same date. It changed the date to the same date of a file with the same name in directory 2. O no.

        initial dt stamp
        c:/Steep/USA Data/State/KY/KY3.gif: 1414863057
        c:/usr/www/steepusa/stage/KY/KY3.gif: 1414863057
        
        1 As string: Sat Nov  1 13:30:57 2014
        2 As string: Sat Nov  1 13:30:57 2014
        
        after 1st open and close
        c:/Steep/USA Data/State/KY/KY3.gif: 1415287289
        c:/usr/www/steepusa/stage/KY/KY3.gif: 1415287289
        
        1 As string: Thu Nov  6 10:21:29 2014
        2 As string: Thu Nov  6 10:21:29 2014
        
        30 sec wait - file 2 opened and closed again
        
        file 1 and 2 after file 2 open/close
        c:/Steep/USA Data/State/KY/KY3.gif: 1415287289
        c:/usr/www/steepusa/stage/KY/KY3.gif: 1415287319
        
        1 As string: Thu Nov  6 10:21:29 2014
        2 As string: Thu Nov  6 10:21:59 2014
        

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2022-08-14 09:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?