[Pythonmac-SIG] file creation dates

Russell E Owen owen at astro.washington.edu
Fri Jun 6 12:38:47 EDT 2003


I've just stumbled across something new to me. In MacPython 2.2.2, 
the st_ctime returned by os.stat was the file creation date. Somehow 
I had the impression that was normal. However, in Mac Python 2.3b1 
and in unix-on-Mac python 2.2.2 the st_ctime is something else 
(perhaps the "time of last status change", whatever that is, as 
documented in Python in a Nutshell).

It is interesting that the st_ctime can be different than the 
st_atime and st_mtime, even under the unix Python 2.2.2 -- I had no 
idea the HFS+ had so many file date entries. Yikes! (And how could 
unix be missing such an important thing as file creation date? Weird.)

Anyway, I've been using file creation date and am wondering what to do.

Is there a simple standard way to get the file creation date in Mac 
Python 2.3b1, preferably one that also works in MacPython 2.2.2?

-- Russell



More information about the Pythonmac-SIG mailing list