S_IRUSR is a macro constant in sys/stat.h of posix. it stands for user read permission bit.
the prefix S_ may stand for ‘status of’
the RUSR maybe Read of User.
but what’s the meaning of ‘I’?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The naming is historic … dating back to the very earliest days of UNIX. The “S” is for STAT, the “I” for INODE (a term not really used in POSIX itself outside Rationale), the “R” for READ and the “USR” for USER.
Inodes do get a few mentions, and the stat structure also includes “st_ino”, which the standard describes as the “File Serial Number”. In many POSIX implementations, an inode is a data structure containing all the meta-data for the file (much of which is what is read by the stat() call).
(From Wikipedia:) The reason for designating these as “i” nodes is unknown. When asked, Unix pioneer Dennis Ritchie replied:
(The “i-” notation was used in the 1st edition manual; its hyphen was gradually dropped.)