[RndTbl] How does umask really work?

John Lange john.lange at open-it.ca
Wed Feb 9 20:22:53 CST 2005


The documentation and examples on umask state that you provide a mask
that is subtracted from rwx (777) access to generate a default access
for newly created files.

It clearly doesn't work this way.

If you have a umask of 022, newly created files are rw-r--r-- (644). It
should be rwxr-xr-x (755). The umask is acting like its 033 and indeed
changing it to 033 has no effect on newly created files.

However, umask effects directories differently. umask 022 will create
directories as expected (as 755), and umask 033 will create them as 644.

So how do you set a umask that will create files as 755?

-- 
John Lange




More information about the Roundtable mailing list