Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: time difference

by mifflin (Curate)
on Aug 01, 2005 at 05:02 UTC ( [id://479795]=note: print w/replies, xml ) Need Help??


in reply to Re: time difference
in thread time difference

Is there a reliable way to get the true file creation time given that -C (and stat 10) is not it?

Replies are listed 'Best First'.
Re^3: time difference
by merlyn (Sage) on Aug 01, 2005 at 05:21 UTC
    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.

      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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-25 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found