This is the mail archive of the
mailing list for the Cygwin project.
Re: cygwin python os.stat gives wrong ctime
- From: Eliot Moss <moss at cs dot umass dot edu>
- To: cygwin at cygwin dot com
- Date: Mon, 30 May 2016 10:53:09 -0400
- Subject: Re: cygwin python os.stat gives wrong ctime
- Authentication-results: sourceware.org; auth=none
- References: <4026b0f6-0514-576e-def4-c5fcd79148b9 at cs dot umass dot edu> <574B42EA dot 9060408 at houseofpain dot org>
- Reply-to: moss at cs dot umass dot edu
On 5/29/2016 3:28 PM, Mitch Deoudes wrote:
On 5/28/2016 10:35 PM, Eliot Moss wrote:
On 5/28/2016 9:39 PM, Mitch Deoudes wrote:
According to the python docs, os.stat() gives the following for st_ctime:
"|st_ctime| - platform dependent; time of most recent metadata change on Unix, or the time of
creation on Windows"
cygwin emulates posix, so you should expect a posix-like result.
I understand your argument, and offer the following, which is from the same section of the python docs:
"On other Unix systems (such as FreeBSD), the following attributes may be available (but may be
only filled out if root tries to use them):
* |st_birthtime| - time of file creation"
Suggesting that it's not "anti-POSIX" (unPOSIX? aPOSIX?) to provide the information if it's available.
Anyway, I've found a more or less suitable workaround for now, batching up the queries and calling
out to the shell - so I'll leave it at that.
It appears, then, that the maintainer of cygwin's python could consider adjusting
for this information to be returned, since cygwin provides it and it would be useful
(at least sometimes). The python spec does say "may" (not "shall" or "must"), so
it seems to me forgivable that it's not currently available. I'd say it's up to
the maintainer to decide, and how to prioritize it.
Regards -- EM
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple