mirror of
https://github.com/aclist/dztui.git
synced 2026-10-25 12:12:31 +01:00
16 lines
356 B
Python
16 lines
356 B
Python
from datetime import datetime
|
|
from pathlib import Path
|
|
|
|
|
|
def is_writeable(path: "Path") -> bool:
|
|
now = int(datetime.now().timestamp())
|
|
suffix = ".dzgtmp"
|
|
file = str(now) + suffix
|
|
filepath = Path(str(path) + "_" + file)
|
|
try:
|
|
filepath.touch()
|
|
filepath.unlink()
|
|
return True
|
|
except OSError:
|
|
return False
|