fs/mkdir
This commit is contained in:
parent
ef45fc9d81
commit
de80d7ecff
1 changed files with 2 additions and 2 deletions
|
@ -49,7 +49,7 @@ def get_path_uuid(path: str) -> str:
|
||||||
|
|
||||||
def make_directory(path: str) -> None:
|
def make_directory(path: str) -> None:
|
||||||
"""Make a directory (and its parents) from a path."""
|
"""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):
|
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:
|
def write(file_path: str, text: str, charset: str = CHARSET) -> None:
|
||||||
"""Write text into a file."""
|
"""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)
|
file_object.write(text)
|
||||||
|
|
Loading…
Reference in a new issue