umask for ordinary files in CSH

Doug Gwyn gwyn at smoke.brl.mil
Fri Apr 5 15:57:57 AEST 1991


In article <1991Apr4.180206.19976 at terminator.cc.umich.edu> bguthy at engin.umich.edu (bala s guthy ) writes:
>--- Here is what the man page for csh says.
>     umask [ value ]
>               the  file creation mask.  value is given in octal,
>               and is XORed with the permissions of 666 for files
>               and  777  for directories to arrive at the permis-
>               sions for new files.

Well, that manual is wrong.  It was a mistake for it to have said anything
more than "sets the process's umask to nnn (see umask(2))".  That is all
the shell does with the umask value specified.  If you look up umask(2) it
should say in effect that the low 12 bits of the umask value are NANDed
with the modes specified for O_CREATs etc.  In other words, 1 bits in the
umask indicate which mode bits are to be turned OFF from the set normally
specified when a file is created.

By the way, this was not a Wizardly question.



More information about the Comp.unix.wizards mailing list