Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!psuvax1!hsdndev!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.unix.wizards Subject: Re: umask for ordinary files in CSH Message-ID: <15715@smoke.brl.mil> Date: 5 Apr 91 05:57:57 GMT References: <1991Apr4.180206.19976@terminator.cc.umich.edu> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 17 In article <1991Apr4.180206.19976@terminator.cc.umich.edu> bguthy@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.