createDirectory is:exact
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]
- isDoesNotExistError There is no path to the directory.
[ENOENT, ENOTDIR]
- 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]
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]
- isDoesNotExistError There is no path to the directory.
[ENOENT, ENOTDIR]
- 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]
createDirectory dir mode calls mkdir to create a new
directory, dir, with permissions based on mode.
createDirectory dir mode calls mkdir to create a new
directory, dir, with permissions based on mode.
createDirectory dir mode calls mkdir to create a new
directory, dir, with permissions based on mode.
Create a directory at a given path. The user may choose whether it is
an error for a directory to already exist at that path.
This computation throws
IOError on failure. See “Classifying
I/O errors” in the
System.IO.Error documentation for
information on why the failure occured.
Create a new directory.
ghci> createDirectory "/tmp/mydir"
ghci> getDirectoryFiles "/tmp/mydir"
[".",".."]
ghci> createDirectory "/tmp/mydir/anotherdir"
ghci> getDirectoryFiles "/tmp/mydir"
[".","..","anotherdir"]
Creates (recursively if necessary) the specified directory. Errors can
be caught using
onError. You should always specify an absolute
path.
createDirectory "$INSTDIR/some/directory"