Ok, remove the first 0 and you get octal (you need at least 3 bits to get to 8). The answer is the same. Now I'll but out and let you continue your discussion. Sorry to have intruded. Corrected--
Wouldn't umask 000 mean 777 under a 000 mask= 777, and umask 022 mean 777 under 022 mask = 755? At the bit level, 000=000 000 000, 777= 111 111 111, and 022=000 010 010? Then umask 022 = 111 111 111 under a mask of 000 010 010 = 111 101 101 = 755? I believe this is what Anders Johansson was saying with his 4/26/2005 @ 11:19 AM post.
Yours truly, Greg Wallace On Wednesday 27 April 2005 13:42, Greg Wallace wrote:
On Wednesday, April 27, 2005 A 5:15 AM, Randall R Schultz wrote:
On Tuesday 26 April 2005 09:35, Ken Schneider wrote:
...
Trying to remember from a failing memory...
Meaning you forget where the documentation is?
umask is the invert of the permissions you want to set. On files a umask of 000 would create files with 666 perms. With 022 it would be 644 and with 044 it would be 622 and last 066 would result in perms of 600.
octal 666 = -rw-rw-rw 644 = -rw-r--r- 622 = -rw--w--w (useless as write permission infers read permission) 600 = -rw------
While I'm sure you mean "implies" (since a permission can not perform the logical act of inferring), it's simply not true.
There are purposes for write-only files and especially for write-only directories (in conjunction with execute permission, of course, and often the sticky bit, too).
Ken Schneider
Randall Schulz
Wouldn't umask 000 mean 777 under a 000 mask= 777, and umask 022 mean 777 under 022 mask = 755? At the bit level, 000=0000 0000 0000, 777= 0111 0111 0111, and 022=0000 0010 0010? Then umask 022 = 0111 0111 0111 under a mask of 0000 0010 0010 = 0111 0101 0101 = 755? I believe this is what Anders Johansson was saying with his 4/26/2005 @ 11:19 AM post.
I'm finding that rather hard to decode, but one thing is for sure, when we give Unix file modes in numeric form, we use octal, not hex, so each digit in the octal number represents _three_ bits, not four. As for the exchange between Anders J. and I, that was about the semantics of the words we use to describe the application of the umask value. I'm pretty sure Anders and I would agree about what file mode would result from any given creat(...) call and umask value.
Greg Wallace
Randall Schulz -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com