Updates the access and last modification times of the file at this file path to the current time. Also creates the file if it does not already exist. @raise Exception: if unable to create or modify the last modification time of the file.
(self)
| 1445 | return f"FilePath({self.path!r})" |
| 1446 | |
| 1447 | def touch(self) -> None: |
| 1448 | """ |
| 1449 | Updates the access and last modification times of the file at this |
| 1450 | file path to the current time. Also creates the file if it does not |
| 1451 | already exist. |
| 1452 | |
| 1453 | @raise Exception: if unable to create or modify the last modification |
| 1454 | time of the file. |
| 1455 | """ |
| 1456 | try: |
| 1457 | self.open("a").close() |
| 1458 | except OSError: |
| 1459 | pass |
| 1460 | utime(self.path, None) |
| 1461 | |
| 1462 | def remove(self) -> None: |
| 1463 | """ |