Skip to content

make_path

Benjamin Loire edited this page Mar 30, 2023 · 1 revision

An important caveat of pathlib in the folder creation is that when parents=True is specified, it will not create the parent folders according to the mode argument but the current umask. To avoid hazardous umask manipulation, this function creates the path in a top-down fashion. All folders are created using the specified mode.

Usage

from OSmOSE.utils import make_path
from pathlib import Path

make_path(Path("path","to","my","folder"), mode=0o775)

Clone this wiki locally