I was reading about file creation mask in a book and came across this:
For example, if the value of the mask is 04+02+01=07 then the permissions normally indicated by these values are turned off whenever a file is created. So, with this value in effect, the file created with the statement:
fd open (" /tmp/newfile", O_CREAT, 0644);
will actually be given a mode of 0640. This means that the file owner and members of the group associated with the file will be able to use the file, but other types of user will be denied any access at all.
I'm can't wrap my head around as to why does the mode changes from 0644 to 0640. And what will be the permission be of the file being created?