what mode_t numbers mean?


Results 1 to 2 of 2

Thread: what mode_t numbers mean?

  1. #1
    Join Date
    Jan 2003
    Location
    USA
    Posts
    18

    what mode_t numbers mean?

    I am not sure if this is a hardware-related question. In Linux, what do those "mode_t" values mean? Where to find the meaning of mostly used mode_t values? Typically, what does "0666" mean?
    /* I use this in creating an entry in /proc" */

    Thanks a lot

  2. #2
    Join Date
    Apr 2001
    Location
    SF Bay Area, CA
    Posts
    14,936
    No, this isn't a hardware question. It's a hybrid programming and software one, so I'll send this off to Programming.

    But as for the answer, read man 2 chmod -- it lists a bunch of macros you can use with mode_t, the macros' values, and what they mean.

    0666, for example, is the bitwise OR of S_IR{USR,GRP,OTH} and S_IW{USR,GRP,OTH}, so with a mode_t of 0666, everyone (the file's owner, the file's group, and others) can read and write to the file. But check the man page for more.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •