createDirectory dir creates a new directory
dir which is initially empty, or as near to empty as the
operating system allows.
The operation may fail with:
isPermissionError The process has insufficient privileges
to perform the operation. [EROFS, EACCES]
isAlreadyExistsError The operand refers to a directory that
already exists. [EEXIST]
HardwareFault A physical I/O error has occurred.
[EIO]
InvalidArgument The operand is not a valid directory
name. [ENAMETOOLONG, ELOOP]
isFullError Insufficient resources (virtual memory, process
file descriptors, physical disk space, etc.) are available to perform
the operation. [EDQUOT, ENOSPC, ENOMEM, EMLINK]
InappropriateType The path refers to an existing
non-directory object. [EEXIST]
createDirectoryIfMissing parents dir creates a new
directory dir if it doesn't exist. If the first argument is
True the function will also create all parent directories if
they are missing.