changeset: 74825:c6e9c4d18b36 user: Victor Stinner date: Wed Feb 08 03:07:25 2012 +0100 files: Lib/test/test_os.py description: Issue #13964: Test also os.futimesat() diff -r d297f9b10c64 -r c6e9c4d18b36 Lib/test/test_os.py --- a/Lib/test/test_os.py Wed Feb 08 03:01:11 2012 +0100 +++ b/Lib/test/test_os.py Wed Feb 08 03:07:25 2012 +0100 @@ -307,7 +307,7 @@ mtime = msec + mmsec * 1e-3 filename = self.fname dirname = os.path.dirname(filename) - for func in ('utime', 'futimes', 'futimens', 'lutimes', 'utimensat'): + for func in ('utime', 'futimes', 'futimens', 'futimesat', 'lutimes', 'utimensat'): if not hasattr(os, func): continue os.utime(filename, (0, 0)) @@ -324,6 +324,13 @@ (msec, mmsec * 1000000)) elif func == 'lutimes': os.lutimes(filename, (atime, mtime)) + elif func == 'futimesat': + dirfd = os.open(dirname, os.O_RDONLY) + try: + os.futimesat(dirfd, os.path.basename(filename), + (atime, mtime)) + finally: + os.close(dirfd) else: dirfd = os.open(dirname, os.O_RDONLY) try:

AltStyle によって変換されたページ (->オリジナル) /