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.

Author vstinner
Recipients Arfrever, eric.araujo, gvanrossum, larry, loewis, maubp, ncoghlan, pitrou, python-dev, r.david.murray, rosslagerwall, shaurz, vstinner
Date 2012-03-13.13:26:53
SpamBayes Score 2.300559e-09
Marked as misclassified No
Message-id <1331645214.24.0.106742603471.issue14127@psf.upfronthosting.co.za>
In-reply-to
Content
The following changes has to be done to fix this issue:

 - add st_atime_ns, st_mtime_ns and st_ctime_ns fileds to os.stat() result: number of nanoseconds since Epoch (1970.1.1), an integer
 - change os.*utime*() functions (see below)
 - shutil.copystat() should use os.utime(ns=...) and os.ltime(ns=...)

List of the os.*utime*() functions:

 - os.futimes(): use futimens() or futimes()
 - os.futimens(): use futimens(); UTIME_NOW and UTIME_OMIT flags
 - os.futimesat(): use utimensat() or futimesat()
 - os.lutimes(): use futimesat(AT_SYMLINK_NOFOLLOW) or lutimes()
 - os.utime(): use SetFileTime() (Windows), utimensat(), utimes() or utime()
 - os.utimensat(): use utimensat(); UTIME_NOW and UTIME_OMIT flags

Changes on the os.*utime*() functions:

 - add ns keyword to:

   * os.futimes()
   * os.futimesat()
   * os.lutimes()
   * os.utime()

 - except a number of nanoseconds instead of a number of seconds:

   * os.futimens()
   * os.utimensat()

The ns keyword is an exclusive parameter with existing times parameter. Examples:

   * seconds: os.utime(name, (1, 2))
   * seconds: os.utime(name, times=(1, 2))
   * nanoseconds: os.utime(name, ns=(1, 2))
   * INVALID! os.utime(name, (1, 2), ns=(1, 2))
   * INVALID! os.utime(name, times=(1, 2), ns=(1, 2))

I don't want to remove os.futimens() and os.utimensat() because they add a feature: UTIME_NOW and UTIME_OMIT flags.
History
Date User Action Args
2012-03-13 13:26:54vstinnersetrecipients: + vstinner, gvanrossum, loewis, ncoghlan, pitrou, larry, eric.araujo, Arfrever, r.david.murray, maubp, shaurz, rosslagerwall, python-dev
2012-03-13 13:26:54vstinnersetmessageid: <1331645214.24.0.106742603471.issue14127@psf.upfronthosting.co.za>
2012-03-13 13:26:53vstinnerlinkissue14127 messages
2012-03-13 13:26:53vstinnercreate