update read_write_file_utils.py

This commit is contained in:
M. A. Reza 2025-09-08 15:15:48 +03:30
parent 19570140a1
commit 12f682dc4d

View File

@ -20,6 +20,12 @@ def write_to_file(content, file_path: Path, json_dumps=False, indent=None):
return f.write(content) return f.write(content)
def write_binary_to_file(content, file_path: Path):
file_path.parent.mkdir(parents=True, exist_ok=True)
with open(file_path, mode="wb") as f:
return f.write(content)
def read_file(file_path, json_loads): def read_file(file_path, json_loads):
with open(file_path, "r") as file: with open(file_path, "r") as file:
if json_loads: if json_loads: