On Wednesday 25 April 2012 23:35, in comp.os.linux.misc,
spamt...@jacob21819.net wrote:
> On 2012-04-26, Lew Pitcher <
lpit...@teksavvy.com> wrote:
>>
>> Let's clarify that statement a bit....
>>
>> umask /takes away/ set permission bits.
>> For every 1bit in the umask, the associated permission bit is set to 0
>> For every 0bit in the umask, the associated permission bit is left alone
>>
>> Thus, if your create/open/chmod mode were
>> 731
>> and you had a umask of
>> 365
>> you would wind up with permissions of
>> 321
>>
>> mode -> 111 011 001 (731)
>> umask -> 011 110 101 (365)
>> ====================
>> perm -> 011 010 001 (321)
>
> Your explanation and example don't mesh.
Gawk! You are correct. D*mn, what was I thinking?
Let's try this again....
Thus, if your create/open/chmod mode were
731
and you had a umask of
365
you would wind up with permissions of
414
mode -> 111 011 001 (731)
umask -> 011 110 101 (365)
====================
perm -> 100 001 100 (414)
| | |
+-----+--+-- These bits come from the mode
The rest were zeroed out by umask
--
Lew Pitcher