The stat calls have a series of symbolic names for the various bits in the mode field. From the stat(2) manual page:
The following mask values are defined for the file mode component of the st_mode field: S_ISUID 04000 set-user-ID bit S_ISGID 02000 set-group-ID bit (see below) S_ISVTX 01000 sticky bit (see below) S_IRWXU 00700 owner has read, write, and execute permission S_IRUSR 00400 owner has read permission S_IWUSR 00200 owner has write permission S_IXUSR 00100 owner has execute permission S_IRWXG 00070 group has read, write, and execute permission S_IRGRP 00040 group has read permission S_IWGRP 00020 group has write permission S_IXGRP 00010 group has execute permission S_IRWXO 00007 others (not in group) have read, write, and execute permission S_IROTH 00004 others have read permission S_IWOTH 00002 others have write permission S_IXOTH 00001 others have execute permission
I can see that
S_IRWXU is a combination of
u (Read, Write
and eXecute permissions for the User) and that
S_IRUSR is combined
usr (Read permission for the USeR). Likewise for Write
and eXecute, and for GRouP and OTHers.
S part is probably named after the
But what about the
I part, what does it mean? Is it modelled after the
S_ISDIR ("is a directory") macros?
What is the
VTX part from
S_ISVTX? I cannot relate this abbreviation
to "sticky bit".