Prototype: int mkdir (const char * filename, mode_t Mode)
If the return value is 0, the operation is successful. If the return value is-1, an error occurs. To use this function, you must include the header file SYS/STAT. h.
Mode indicates the permission of the new directory. You can use the following values:
S_irusr
S_iread
Read Permission bit for the owner of the file. on Alibaba systems this bit is 0400. s_iread is an obsolete synonym provided for BSD compatibility.
S_iwusr
S_iwrite
Write Permission bit for the owner of the file. Usually 0200. s_iwrite is an obsolete synonym provided for BSD compatibility.
S_ixusr
S_iexec
Execute (for ordinary files) or search (for directories) Permission bit for the owner of the file. Usually 0100. s_iexec is an obsolete synonym provided for BSD compatibility.
S_irwxu
This is equivalent to (s_irusr | s_iwusr | s_ixusr ).
S_irgrp
Read Permission bit for the group owner of the file. Usually 040.
S_iwgrp
Write Permission bit for the group owner of the file. Usually 020.
S_ixgrp
Execute or search permission bit for the group owner of the file. Usually 010.
S_irwxg
This is equivalent to (s_irgrp | s_iwgrp | s_ixgrp ).
S_iroth
Read Permission bit for other users. Usually 04.
S_iwoth
Write Permission bit for other users. Usually 02.
S_ixoth
Execute or search permission bit for other users. Usually 01.
S_irwxo
This is equivalent to (s_iroth | s_iwoth | s_ixoth ).
S_isuid
This is the set-user-id on execute bit, usually 04000. See how change persona.
S_isgid
This is the set-group-ID on execute bit, usually 02000. See how change persona.
S_isvtx
This is the sticky bits, usually 01000.