1833059 Members
2623 Online
110049 Solutions
New Discussion

UMASK is not XORed

 
John_140
New Member

UMASK is not XORed

To find the resulting file permissions you do not XOR the UMASK with 666 (for files) or 777 (for directories).

Instead you take the bitwise inverse of the UMASK and then AND it with either 666 or 777.

To see this try XORing 033 octal with 666. The resulting permission would be incorrect.

Compare this with taking the bitwise inverse of 033 octal and then ANDing it with 666.