Updates the modified timestamp of a file or directory.
(path, times=None)
| 54 | |
| 55 | |
| 56 | def touch(path, times=None): |
| 57 | """Updates the modified timestamp of a file or directory.""" |
| 58 | if os.path.isdir(path): |
| 59 | os.utime(path, times) |
| 60 | else: |
| 61 | with open(path, "ab"): |
| 62 | os.utime(path, times) |
| 63 | |
| 64 | |
| 65 | def truncate(path): |
searching dependent graphs…