Go to the first, previous, next, last section, table of contents.


mkdir

Syntax

#include <sys/stat.h>

int mkdir(const char *path, mode_t mode);

Description

This function creates a subdirectory.

All the bits except S_IWUSR in the mode argument are ignored under MS-DOS. If S_IWUSR is not set in mode, the directory is created with read-only attribute bit set. Note that DOS itself ignores the read-only bit of directories, but some programs do not.

Return Value

Zero if the subdirectory was created, nonzero on failure.

Portability

not ANSI, POSIX

Example

mkdir("/usr/tmp", S_IWUSR);


Go to the first, previous, next, last section, table of contents.