Mkdir function-linux mkdir function header file library: # include <sys/stat. h> # include <sys/types. h> function prototype: int mkdir (const char * pathname, mode_t mode); Function Description: The mkdir () function creates a directory named after the pathname parameter in mode, mode defines the permissions for creating a directory. Returned value: If the directory is successfully created, 0 is returned; otherwise,-1 is returned and the error is recorded in the global variable errno.
Mode: S_IRWXU 00700 indicates that the object owner has the read, write, and execute permissions S_IRUSR (S_IREAD) 00400, and S_IWUSR (S_IWRITE) indicates that the object owner has the read permission S_IWUSR (S_IWRITE) 00200 permission indicates that the file owner has the write permission S_IXUSR (S_IEXEC) 00100 permission, indicating that the file owner has the execution permission S_IRWXG 00070, indicating that the file user group has the read permission, the write and execute permissions S_IRGRP 00040 indicate that the file user group has the read permission S_IWGRP 00020, indicating that the file user group has the write permission S_IXGRP 00010, this indicates that the file user group has the permission to execute S_IRWXO 00007, that is, other users have the permission to read, write, and execute operations S_IROTH 00004, and that other users have the read permission S_IWOTH 00002, indicates that other users have the write permission S_IXOTH 00001, and other users have the execution permission.