diff --git a/rwx/fs/__init__.py b/rwx/fs/__init__.py index cb97ceb..1037fd0 100644 --- a/rwx/fs/__init__.py +++ b/rwx/fs/__init__.py @@ -49,7 +49,7 @@ def get_path_uuid(path: str) -> str: def make_directory(path: str) -> None: """Make a directory (and its parents) from a path.""" - os.makedirs(path, exist_ok=True) + Path(path).mkdir(exist_ok=True, parents=True) def read_file(file_path: str): @@ -77,5 +77,5 @@ def wipe(path: str) -> None: def write(file_path: str, text: str, charset: str = CHARSET) -> None: """Write text into a file.""" - with Path(file_path).open(mode="w", encoding=charset) as file_object: + with Path(file_path).open(encoding=charset, mode="w") as file_object: file_object.write(text)