Creates the directory specified by Path.

If some parent directory of the specified path does not exist, then the command fails.

Since 3.16

The default authorizations of the newly created directory are defined by the File.DefaultDirAuth property.


MKDIR "/tmp/xxnn"


Message Description
Access forbidden (43) The parent directory does not allow write permission to the process, or one of the directories in Path did not allow search permission.
File or directory does not exist (45) A directory component in Path does not exist or is a dangling symbolic link.
Not a directory (49) A component used as a directory in Path is not, in fact, a directory.
Out of memory (1) Insufficient kernel memory was available.
File name is too long (44) Path was too long.
Device is full (37) The device containing Path has no room for the new directory.
File already exists (38) Path already exists (not necessarily as a directory). This includes the case where Path is a symbolic link, dangling or not.
System error... (42) Other possible system errors:
  • Too many symbolic links were encountered in resolving Path.

  • The filesystem containing pathname does not support the creation of directories.

  • Path refers to a file on a read-only filesystem.

See also