Create a directory.
Syntax
#include <sys/stat.h>
int mkdir (const char *path, mode_t mode);
Parameters
-
path
The name of the folder to create.
-
mode
The access rights (mode) of the directory to create.
Return Value
The return value is null if successful. Otherwise, the return value is negative and errno is set:
-
ENOENT
No such file or directory (could not resolve the path).
-
ENOSYS
The system call is not supported for this file system, or not implemented.
Remarks
SocketFS, ProcFS, KFS and DevFS does not support mkdir
, since these file
systems are read-only from userspace. PipeFS does not support the creation of
directories.
The FATFS plugin currently ignores the mode
value, since it uses the FAT32
file system that does not keep this value.