Set modification time for the given path. if 'mtime' is None (the default) then the file's mtime is set to current time. Note that the resolution for 'mtime' is platform dependent.
(self, mtime=None)
| 980 | return Stat(self, error.checked_call(os.lstat, self.strpath)) |
| 981 | |
| 982 | def setmtime(self, mtime=None): |
| 983 | """Set modification time for the given path. if 'mtime' is None |
| 984 | (the default) then the file's mtime is set to current time. |
| 985 | |
| 986 | Note that the resolution for 'mtime' is platform dependent. |
| 987 | """ |
| 988 | if mtime is None: |
| 989 | return error.checked_call(os.utime, self.strpath, mtime) |
| 990 | try: |
| 991 | return error.checked_call(os.utime, self.strpath, (-1, mtime)) |
| 992 | except error.EINVAL: |
| 993 | return error.checked_call(os.utime, self.strpath, (self.atime(), mtime)) |
| 994 | |
| 995 | def chdir(self): |
| 996 | """Change directory to self and return old current directory""" |