Directories are created with the mkdir
function. (There is also
a shell command mkdir
which does the same thing.)
mkdir
function creates a new, empty directory with name
filename.
The argument mode specifies the file permissions for the new directory file. See section The Mode Bits for Access Permission, for more information about this.
A return value of 0
indicates successful completion, and
-1
indicates failure. In addition to the usual file name syntax
errors (see section File Name Errors), the following errno
error
conditions are defined for this function:
EACCES
EEXIST
EMLINK
ENOSPC
EROFS
To use this function, your program should include the header file `sys/stat.h'.
Go to the first, previous, next, last section, table of contents.