feat: add file module

This commit is contained in:
aclist 2026-05-28 02:41:41 +09:00
parent 24d3bc8209
commit 15d928026a

15
dzgui/util/file.py Normal file
View File

@ -0,0 +1,15 @@
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