According to python 3.6 documentation, a directory can be created via:
pathlib.Path.mkdir(mode=0o777, parents=False, exist_ok=False)
os.mkdir(path, mode=0o777, *, dir_fd=None)
os.makedirs(name, mode=0o777, exist_ok=False)
Questions:
- It looks like
pathlib.Path.mkdir()
does most of whatos.mkdir()
andos.makedirs()
do. Ispathlib.Path.mkdir()
a "modern" implementation of bothos.mkdir()
andos.makedirs()
? - When should I use
pathlib.Path.mkdir()
vsos.mkdir()
oros.makedirs()
? Any performance differences?
Please explain in relation to POSIX considerations. Thanks.