Gunnar Hjalmarsson wrote: > Bob Showalter wrote: > > You need to set umask to 0 before creating the file. > > > > But don't do that. It's inadvisable to mess with the umask in a > > program, IMO. > > Why would that be inadvisable?
The spirit of umask is to allow the user/sysadmin to control the "policy" for permissions. It's desinged to be under the user's control. If you change the umask in the program, you force me to chmod the file after I run the program if I don't like the bits. > > > If the user wants to create files as 666, let him set the umask > > before running your program. > > If the program, for some reason, requires that a file it creates has > certain permissions, isn't it better to have the program set those > permissions? Why would the program itself require this? Perhaps the way I'm _using_ the program requires this, but then let me control the environment. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>