Message152825
| Author |
vstinner |
| Recipients |
ncoghlan, vstinner |
| Date |
2012年02月08日.01:19:52 |
| SpamBayes Score |
1.4485635e-12 |
| Marked as misclassified |
No |
| Message-id |
<1328663994.2.0.189878263913.issue13964@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Python 3.3 has 4 new functions to set the access and modification time of a file (only os.utime() was already present in Python 3.2). New functions taking timestamp with a nanonsecond resolution use a tuple of int because the float type doesn't support nanosecond resolution. Thanks to the PEP 410, we can simplify the API to use a simple number (int, float or Decimal) instead of a tuple of 2 integers.
Current API:
- futimes(fd[, (atime, mtime)]): 1 argument for timestamps
- lutimes(path[, (atime, mtime)]): 1 argument for timestamps
- utime(path[, (atime, mtime)]): 1 argument for timestamps
- futimens(fd[, (atime_sec, atime_nsec), (mtime_sec, mtime_nsec)]): 2 arguments for timestamps
- utimensat(dirfd, path[, atime=(atime_sec, atime_nsec), mtime=(mtime_sec, mtime_nsec), flags=0]): 2 arguments for timestamps
I propose to:
- support Decimal type in all functions: avoid conversion to float to not lose precision
- remove os.futimens(): os.futimes() does already use futimens() if the function is present (and Decimal can be used to get nanosecond resolution)
- change os.utimensat() API to: os.utimensat(dirfd, path[, (atime, mtime), flags=0]) |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年02月08日 01:19:54 | vstinner | set | recipients:
+ vstinner, ncoghlan |
| 2012年02月08日 01:19:54 | vstinner | set | messageid: <1328663994.2.0.189878263913.issue13964@psf.upfronthosting.co.za> |
| 2012年02月08日 01:19:53 | vstinner | link | issue13964 messages |
| 2012年02月08日 01:19:52 | vstinner | create |
|