mkdir (dirname, mode)
The name of the directory to create.
The access permissions of the new directory, joined in sequence. If there are more than one, they are OR'ed by the | character in text format, or written consecutively in octal format. (See below.)
This function creates a new sub-directory whose path-name is dirname. The file permissions for the new sub-directory are determined from the mode argument. Valid modes are summarized here.
Table 12. User/owner permission modes
Text format | Octal format | Meaning |
---|---|---|
S_IRWXU | 0o7 | Read, write, execute/search |
S_IRUSR | 0o4 | Read permission |
S_IWUSR | 0o2 | Write permission |
S_IXUSR | 0o1 | Execute/search permission |
Table 13. Group permission modes
Text format | Octal format | Meaning |
---|---|---|
S_IRWXG | 0o7 | Read, write, execute/search |
S_IRGRP | 0o4 | Read permission |
S_IWGRP | 0o2 | Write permission |
S_IXGRP | 0o1 | Execute/search permission |
Table 14. Other permission modes
Text format | Octal format | Meaning |
---|---|---|
S_IRWXO | 0o7 | Read, write, execute/search |
S_IROTH | 0o4 | Read permission |
S_IWOTH | 0o2 | Write permission |
S_IXOTH | 0o1 | Execute/search permission |
Miscellaneous permissions.
S_IREAD same as S_IRUSR
S_IWRITE same as S_IWUSR
S_IEXEC same as S_IXUSR
These flags are bitwise OR-ed together to get the desired mode.
Error constants for this function:
EACCES Search permission for some component of the path denied.
EEXIST The named file exists.
EMLINK Maximum sub-dirs. reached.
ENAMETOOLONG The name of the path or the new directory is too long.
ENOENT The specified path does not exist.
ENOSPC No space left on the file system.
ENOSYS This function is not supported for this path.
ENOTDIR A component of the passed path is not a directory.
EROFS Tried to create a directory on a read-only file system.
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.