previous | start | next

Example

For a umask of 0022 and requested_permissions of 0660 (rw-rw-rw-), actual_permissions are calculated as 0640 (rw-r--r--)

        actual_permissions = specified_permissions & ~umask  
        umask                 = 0022 = 000 010 010

       ~umask                 = 0755 = 111 101 101
        requested_permissions = 0666 = 110 110 110
umask & requested_permissions = 0644 = 110 100 100
     

So for umask = 0022, the actual permissions are 0644 (rw-r--r--), not 666 (rw-rw-rw-). Group and Others will be able to read from, but not write to this file.



previous | start | next