Re: umask of files created in COMPILE_DIR

Todd Wade <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.template-toolkit
Message-ID <[email protected]>

From: Larry Leszczynski <[email protected]>
> It's true that File::Temp sets the mode of the file explicitly, because
> it creates the file as 0600 (at which point umask would be applied)

I'm not seeing a umask being applied when File::Temp creates the file:

$ umask
0002
$ touch touched
$ perl -MFcntl -e 'sysopen(my $fh, "./sysopened", O_WRONLY | O_APPEND | O_CREAT, 
0600)'
$ ls -l
-rw-------  1 me  me  0 Sep  9 10:35 sysopened
-rw-rw-r--  1 me  me  0 Sep  9 10:35 touched

If I take out the 0600 from the sysopen call, then the file gets g+r,g+w

> and then explicitly does a "chmod 600" (overriding any effect 
> umask would have had).

If I take the chmod out of File::Temp, the file still gets g+r,g+w only.

Todd W.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.