feat: add file module

This commit is contained in:
aclist committed 2026-05-28 02:41:41 +09:00
1 parent 24d3bc8209
commit 15d928026a
1 file changed
+15
+15
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