Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion upath/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1755,7 +1755,10 @@ def touch(self, mode: int = 0o666, exist_ok: bool = True) -> None:
if exists and not exist_ok:
raise FileExistsError(str(self))
if not exists:
self.fs.touch(self.path, truncate=True)
try:
self.fs.touch(self.path, truncate=True)
except NotImplementedError:
_raise_unsupported(type(self).__name__, "touch")
else:
try:
self.fs.touch(self.path, truncate=False)
Expand Down
Loading