diff --git a/rwx/fs/__init__.py b/rwx/fs/__init__.py index 1037fd0..b1da3a2 100644 --- a/rwx/fs/__init__.py +++ b/rwx/fs/__init__.py @@ -52,8 +52,9 @@ def make_directory(path: str) -> None: Path(path).mkdir(exist_ok=True, parents=True) -def read_file(file_path: str): - with open(file_path, "br") as file_object: +def read_file_bytes(file_path: str) -> bytes: + """Read whole file bytes.""" + with Path(file_path).open("br") as file_object: return file_object.read() @@ -62,7 +63,7 @@ def read_file_lines(file_path: str, charset: str = CHARSET): def read_file_text(file_path: str, charset: str = CHARSET): - return read_file(file_path).decode(charset) + return read_file_bytes(file_path).decode(charset) def wipe(path: str) -> None: