summaryrefslogtreecommitdiff
path: root/backend/files.py
diff options
context:
space:
mode:
authorxXJsonDeruloXx <danielhimebauch@gmail.com>2026-08-01 15:14:09 -0400
committerxXJsonDeruloXx <danielhimebauch@gmail.com>2026-08-01 15:14:09 -0400
commitcc5eb55dbe02d65910c5278a375d0d5640374208 (patch)
tree522764d808b097e69a2398cb2db7e0cd09167353 /backend/files.py
parent02521a797e195b331af1778cd7bc854d3a396ead (diff)
downloadDecky-Framegen-cc5eb55dbe02d65910c5278a375d0d5640374208.tar.gz
Decky-Framegen-cc5eb55dbe02d65910c5278a375d0d5640374208.zip
fix package layout for Decky runtime modulessafe-patch-refactor
Diffstat (limited to 'backend/files.py')
-rw-r--r--backend/files.py36
1 files changed, 0 insertions, 36 deletions
diff --git a/backend/files.py b/backend/files.py
deleted file mode 100644
index c5ec839..0000000
--- a/backend/files.py
+++ /dev/null
@@ -1,36 +0,0 @@
-"""Small filesystem helpers shared by backend services."""
-
-import filecmp
-import hashlib
-import json
-from pathlib import Path
-
-
-def file_sha256(path: Path) -> str:
- digest = hashlib.sha256()
- with path.open("rb") as stream:
- for chunk in iter(lambda: stream.read(1024 * 1024), b""):
- digest.update(chunk)
- return digest.hexdigest()
-
-
-def files_match(file_a: Path, file_b: Path) -> bool:
- try:
- return file_a.is_file() and file_b.is_file() and filecmp.cmp(file_a, file_b, shallow=False)
- except OSError:
- return False
-
-
-def read_json(path: Path) -> dict:
- try:
- with path.open("r", encoding="utf-8") as stream:
- payload = json.load(stream)
- return payload if isinstance(payload, dict) else {}
- except (OSError, ValueError, TypeError):
- return {}
-
-
-def write_json(path: Path, payload: dict) -> None:
- path.parent.mkdir(parents=True, exist_ok=True)
- with path.open("w", encoding="utf-8") as stream:
- json.dump(payload, stream, indent=2)