From 12f682dc4d7a10df83a5aa90924425ff8b3ab678 Mon Sep 17 00:00:00 2001 From: "M. A. Reza" Date: Mon, 8 Sep 2025 15:15:48 +0330 Subject: [PATCH] update read_write_file_utils.py --- utils/read_wirte_file_utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utils/read_wirte_file_utils.py b/utils/read_wirte_file_utils.py index 2558196..c36088b 100644 --- a/utils/read_wirte_file_utils.py +++ b/utils/read_wirte_file_utils.py @@ -20,6 +20,12 @@ def write_to_file(content, file_path: Path, json_dumps=False, indent=None): 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): with open(file_path, "r") as file: if json_loads: