Node:Creating Directories, Next:File Attributes, Previous:Renaming Files, Up:File System Interface
Directories are created with the mkdir
function. (There is also
a shell command mkdir
which does the same thing.)
int mkdir (const char *filename, mode_t mode) | Function |
The mkdir function creates a new, empty directory with name
filename.
The argument mode specifies the file permissions for the new
directory file. See Permission Bits, 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 File Name Errors), the following errno error
conditions are defined for this function:
sys/stat.h .
|