| 976 | self.dircache.pop("", None) |
| 977 | |
| 978 | def touch(self, path: str, truncate: bool = True, **kwargs) -> dict[str, Any]: |
| 979 | bucket, key, version_id = self.parse_path(path) |
| 980 | if version_id: |
| 981 | raise ValueError("Cannot touch the file with the version specified.") |
| 982 | if not truncate and self.exists(path): |
| 983 | raise ValueError("Cannot touch the existing file without specifying truncate.") |
| 984 | if not key: |
| 985 | raise ValueError("Cannot touch the bucket.") |
| 986 | |
| 987 | object_ = self._put_object(bucket=bucket, key=key, body=None, **kwargs) |
| 988 | self.invalidate_cache(path) |
| 989 | return object_.to_dict() |
| 990 | |
| 991 | def cp_file( |
| 992 | self, path1: str, path2: str, recursive=False, maxdepth=None, on_error=None, **kwargs |