The "modification time" and "last accessed time" work the same on Unix and Windows and these two times are normally sufficient for doing whatever is needed. I would suggest staying away from ctime because it is a bit different between Windows and Unix.

I would, however, ask what creation time signifies. What happens when a file is restored? Does the attribute follow on a copy? How about when the method of saving a file is "save new, rename old, rename new, remove old"?

Creation time would be the time when this file first "came into being". Basically that means it is a constant generated at file creation. It could be that there is some ancient Windows file that is many years old but which gets changed and accessed a lot! If you copy a file (or restore it), the creation time follows it. If you go through the sequence you asked about, file "new" will get a creation time of "right now" because it is literally a "brand new file". The more recent version of file "old" will wind up with that creation time of file "new" instead of whatever date the original file "old" had.

The name in the directory is just a way for a human readable set of bits (the name) to be associated with some set of data bits on the disk. That look up in the directory is what happens when you do an "open file". Once you have opened a file, the name is irrelevant, the file handle is essentially a pointer to a structure that describes the file...how big it is, what physical disk block it starts on, and other attributes like modification time, etc. All that stuff exists independent of the "name".

I hoped this helped rather than further confusing things.


In reply to Re^4: How to get the File creation date by Marshall
in thread How to get the File creation date by soubalaji

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.