Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8883327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:47:13+00:00 2026-06-14T20:47:13+00:00

I was looking at the permission bits used in various functions like stat() and

  • 0

I was looking at the permission bits used in various functions like stat() and chmod(), and I wanted a description of what the macros defined actually are. For instance S_IRUSR says it’s represented by 00400 (GNU/Linux). My question is, could someone describe what the 00400 actually is? Is it a number, what? I understand how to OR the macros, I just don’t get what the macro actually is.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:47:14+00:00Added an answer on June 14, 2026 at 8:47 pm

    I am going to describe the left most three numbers in permission and that would also explain about S_IRUSR,

    So each of the numbers is an octal number. Each number could be from 0 to 7. Each octal number could be converted to 3-bit binary number. Each bit represents a permission.

    Left most bit = Read permission
    Middle bit    = Write permission
    Right most bit= Execute permission
    

    Lets write 0 to 7 into binary and see the permission bits:

    Octal    Binary 
    0        0 0 0 (No Read,  No Write,  No Execute) -- No permission
    1        0 0 1 (No Read,  No Write,  Yes you can execute)
    2        0 1 0 (No Read,  Can Write, No execute)
    3        0 1 1 (No Read,  Can Write, Can execute)
    4        1 0 0 (Can Read, No Write,  No Execute)
    5        1 0 1 (Can Read, No Write,  Can execute)
    6        1 1 0 (Can Read, Can Write, No execute)
    7        1 1 1 (Can Read, Can Write, Can execute)
    

    So each number represents permissions. Now next part is for who these pemmissions are.
    Let the left most three number be XYZ:
    Now,

    X means permission given to the owner of the file.
    Y means permission given to the group of the owner.
    Z means permission given to all other users in system , outside of user's group.
    

    Given that, Z_ISUSR = 00400, now 4 means readable by user IRUSR = Is Readable by user.

    These three are the important numbers in permissions, and these only specify the permissions given to the file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking for best advice on how to do this: I have an insert like
I'm looking for any advice/intuition/clues/answers on a permission issue that has been plaguing me
After looking for ways to check if a user has a given permission, I
I'm looking for a set of scenarios that can be used to assess the
Is there a way to ignore file permission / mode (chmod) changes for a
So, what I'm actually looking for is this solution: Get/pick an image from Android's
I'm looking to re use the success/done function that was used for a jquery
I like to custom edit the permission of users after creating or editing an
I have read only permission on a SQL Server 2005 database, and I'm looking
Looking to do a security audit of all user permissions. I think I can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.