mkdir()

audeer.mkdir(path, *paths, mode=511)[source]

Create directory.

Create a directory at the provided path and return the absolute path to the generated directory. If parent directories are missing, they are created as well. If the directory exists already, only its absolute path is returned.

On some systems, mode is ignored. Where it is used, the current umask value is first masked out. If bits other than the last 9 (i.e. the last 3 digits of the octal representation of the mode) are set, their meaning is platform-dependent. On some platforms, they are ignored and you should call os.chmod() explicitly to set them.

Parameters
Return type

str

Returns

absolute path to the created directory

Examples

>>> p = mkdir("path1", "path2", "path3")
>>> os.path.basename(p)
'path3'