cygwin python os.stat gives wrong ctime

Mitch Deoudes mitch@houseofpain.org
Mon May 30 08:09:00 GMT 2016



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.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list