[issue14127] os.stat and os.utime: allow preserving exact metadata

Antoine Pitrou report at bugs.python.org
Sun Feb 26 17:18:07 CET 2012


Antoine Pitrou <pitrou at free.fr> added the comment:

>>> st = os.stat('LICENSE')
>>> st.st_mtime
1330108216.7984242
>>> st.st_mtime_frac
0.798424152
>>> tup = st.st_mtime, st.st_mtime_frac
>>> os.utime('LICENSE', (tup, tup))

Of course, the fact that utime takes a (atime, mtime) tuple makes this a bit cumbersome.
When passed a tuple, utime would ignore the fractional part of the first element.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14127>
_______________________________________


More information about the Python-bugs-list mailing list