umask question
Nathan Meyers
nmeyers at javalinux.net
Fri Jul 12 11:41:16 EDT 2002
On Fri, Jul 12, 2002 at 11:24:14AM -0400, David Kramer wrote:
> (this is on freebsd if it matters)
>
> If I "umask 0" and create a file, that file is coming out 666 instead of
> 777. Am I missing something?
Creating it how - from a shell, in a program? With system or stdio calls?
The mode of a newly created file is set (and modified by the umask)
in the low-level creat(2) or open(2) system call. Most applications -
including anything using the C library's fopen(3) call - don't set the
execute bits at the time the file is created. So your umask setting
allows the execute bits to be set at file creation if the app requests
it... but the app still has to request it.
Nathan Meyers
nmeyers at javalinux.net
More information about the Discuss
mailing list