This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: I would like an easy way to get to file creation date
Type: enhancement Stage:
Components: macOS Versions:
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: jackjansen Nosy List: jackjansen, reowen
Priority: normal Keywords:

Created on 2004-01-16 22:52 by reowen, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg19722 - (view) Author: Russell Owen (reowen) Date: 2004-01-16 22:52
With Carbon MacPython it is trivial to get to the file creation date; it is one of the fields returned by os.stat. With Framework MacPython this is no longer the case.

I am sure that the interface to the MacOS APIs allow one to do this. I played around some and could see how I could probably get the info, but in what format I had no idea and it was fairly complicated.

If you are willing, it'd be nice to have easier access to this info (and perhaps it exists and I've missed it). I can imagine two possible solutions:
- expand os.stat so the return object includes the extra attribute; this would be convenient, but would make the mac version nonstandard. Of course the windows version could also include this info, leaving unix the "odd man out".
- add a convenience method or function to some existing mac library

Of course it's an interesting question how many users actually need this info. I ended up using it for processing some measurement results (the language used to write the data files was too crude to include a date in the files). Still...it's clear folks to have use for file info, and it's nice if it's readily available. Thanks for your consideration.

-- Russell
msg19723 - (view) Author: Jack Jansen (jackjansen) * (Python committer) Date: 2004-06-03 21:23
Logged In: YES 
user_id=45365

macfs.FSSpec(filename).GetDates() returns 3 time value: creation, 
modification and backup.

macfs is listed as deprecated, but that won't happen until there are easy 
interfaces to some of the things that are still missing from Carbon.File 
(such as getting at the creation date:-)
History
Date User Action Args
2022-04-11 14:56:02adminsetgithub: 39833
2004-01-16 22:52:57reowencreate