cygwin python os.stat gives wrong ctime

Yaakov Selkowitz yselkowitz@cygwin.com
Tue May 31 09:17:00 GMT 2016


On 2016-05-30 03:39, Corinna Vinschen wrote:
> On May 28 21:39, Mitch Deoudes wrote:
> Cygwin's ctime is Change time, not Birth time, that's why Cygwin's stat
> structure comes with an additional st_birthtime as on the BSDs.
>
> I have no idea if python has a compile time option to make st_birthtime
> visible, though.

It already is:

$ python
Python 2.7.10 (default, Jun  1 2015, 18:17:45)
[GCC 4.9.2] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> import os
 >>> st = os.stat('python.cygport')
 >>> print(st)
posix.stat_result(st_mode=33188, st_ino=281474978441936, 
st_dev=3300977488, st_nlink=1, st_uid=197608, st_gid=197121, 
st_size=3535, st_atime=1363164377, st_mtime=1464116088, st_ctime=1464116088)
 >>> print(st.st_birthtime)
1391923515.0

-- 
Yaakov

--
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