File Permissions Chart
This document is a model of how UNIX and UNIX-like operating systems set their file permissions bits.
While other OSes may use this or a similar scheme to represent their permissions,
Mac OS X now uses this scheme for sure.
The top line of the model represents the file permission, where an 'x' means executable (or if the file is a directory,
that it can be traversed). An 'r' means the file is readable, and a 'w' means the file can be written to.
The second line shows the binary representation of that specific permission. While the third line show what
the decimal version of the binary is. Since decimal is typically far easier to think of than binary, we can use
decimal values to set permissions in our OS. In this case OS X.
An example: The binary equivalent of the number 1 is also 1. 2 is 10, and 3 is 11. Don't think that 2 equals 10, obviously it doesn't.
In the same manner that we represent numbers greater than 9 by adding a 1 and starting over at 0, with binary we do the same
thing for values greater than 1.
Using decimal, the number after 9 is 10. Using binary, the number after 1 is 10. This is NOT ten, but rather a one and a zero.
Decimal means that we can count using ten (10) digits before we shift and start counting again (starting at zero (0)).
Binary means that we only have two (2)--0 and 1. So, when we count, anything past the number 1 needs to be dealt with.
We do this by putting a 1 as a placeholder and then start counting from zero again until we get to 1.
A sequence of twenty numbers starting at zero is show here:
| Binary |
|
Decimal |
0
1
10
11
100
101
110
111
1000
1001
1010
1011
1100
1101
1110
1111
10000
10001
10010
10011
|
|
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
Since a specific permission type will always show up in the same place we can use binary numbers to know what permission will
be "turned on" with a specific binary value. The scheme is always "rwx." So, if there is a binary number that looks like 101,
we can think of the read and execute permissions being set. Or, r-x. This is represented by the decimal number 5.
| Perm.: |
- | - | x | |
- | w | - | |
- | w | x | |
r | - | - | |
r | - | x | |
r | w | - | |
r | w | x |
| Bit: |
0 | 0 | 1 | |
0 | 1 | 0 | |
0 | 1 | 1 | |
1 | 0 | 0 | |
1 | 0 | 1 | |
1 | 1 | 0 | |
1 | 1 | 1 |
| Dec.: |
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 |
Copyright © 2005,
Kaomso