From 15d928026a1547abfe383cbfeaa8afa3544a9d92 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Thu, 28 May 2026 02:41:41 +0900 Subject: [PATCH] feat: add file module --- dzgui/util/file.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 dzgui/util/file.py diff --git a/dzgui/util/file.py b/dzgui/util/file.py new file mode 100644 index 0000000..b655336 --- /dev/null +++ b/dzgui/util/file.py @@ -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