Gunnar Hjalmarsson wrote:
> Bob Showalter wrote:
> > Chris Devers wrote:
> > > Maybe the program is a code generator that produces other files
> > > which should be executable (I can't remember anyone doing this,
> > > but there's no reason why it couldn't be reasonably be done).
> > 
> > Fine, use creation bits of 0777.
> 
> Are you saying that
> 
>      open FH, "> $file";
>      chmod 0777, $file;
> 
> is fine, while
> 
>      umask 0;
>      sysopen FH, $file, O_CREAT|O_RDWR, 0777;
> 
> is not? In that case, I'm really confused by now. ;-)

No, I'm saying that neither is fine. Just pass 0600 or 0777 to open(2) and
let the umask determine the resulting permissions. I don't want the program
to decide for me that the file needs to have world write priv, for example.

I'm still struggling to think of a real-world situation where a file would
_have_ to be created as rw-rw-rw- or rwxrwxrwx.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to