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

Re^3: time difference

by merlyn (Sage)
on Aug 01, 2005 at 05:21 UTC ( [id://479799]=note: print w/replies, xml ) Need Help??


in reply to Re^2: time difference
in thread time difference

Not in Unix. The Unix founders argue (and I agree) that "creation time" is at best an odd concept. But you didn't say on what platform, so you may be able to get a "fake" creation time proposed by your platform.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^4: time difference
by BrowserUk (Patriarch) on Aug 01, 2005 at 05:42 UTC
    The Unix founders argue (and I agree) that "creation time" is at best an odd concept.

    Care to explain that?

    dir thisfile File not found. echo . > thisfile dir thisfile 01/08/2005 06:38 4 thisfile

    The file was created. The time tells you when it was created. How is that false or ambiguous?


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.
      The file was created. The time tells you when it was created. How is that false or ambiguous?
      Now, let's say I update the information.

      I could do it one of two ways. I can copy all the data to a new file, then rename the file back over to the existing name. Or I could rewrite the file in place with the new information: more dangerous, but just as valid.

      Should these both have the same original creation time, the creation time of when I started to do the update, or the creation time of when I finished closing the file?

      Should both methods result in the same creation time?

      See, the problem is, what does "creation" mean once you can change things? The "creation" of the string "hello world" where "HELLO world" was formerly is "right now", is it not? So why should the creation time reflect an older timestamp than just now?

      From when do you measure the beginning of the existance of "this file", when the contents can be changed?

      The Unix founders therefore argued that there is no sensible consistent definition for "creation time", and got rid of it entirely. Yeay.

      Instead, we get three very useful, and clearly defined, timestamps. Time of last access (useful to find stale or unused files), time of last contents-modified (used by make), and time of last contents-or-meta-info-changed (used by backups).

      -- Randal L. Schwartz, Perl hacker
      Be sure to read my standard disclaimer if this is a reply.

        Okay. Thanks for the history lesson. :)

        I guess you could argue that there is a difference between a file and it's contents, and that a file moved or updated in place is a modification of the original file, whereas a file copied or overwritten is a different file, but I don't expect that would have much of an effect.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
        "Science is about questioning the status quo. Questioning authority".
        The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-03-28 08:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found