Phoenix.pm: dumb question

Phaedrus phaedrus at endless.org
Fri Oct 22 09:42:22 CDT 1999


Glen..

This is probably all stuff that you are aware of, but:
Off the top of my head:
Permissions always start at 666 (everything for everyone). Umasks may be
set in the /etc/profile or csh equivilent (the global config file for your
shell), your login .profile or .cshrc (by shell), or a umask statement.
Remember that Perl does not speak octal (does it?) and wants a hex or dec
number. Octal will just confuse it. 
Hope this helps (somehow).
Goodluck.
-scott


Here is an excerpt from 'man perlfunc', on creating new files:
               If the file named by FILENAME does not exist and
               the open() call creates it (typically because MODE
               includes the O_CREAT flag), then the value of
               PERMS specifies the permissions of the newly
               created file.  If you omit the PERMS argument to
               sysopen(), Perl uses the octal value 0666.  These
               permission values need to be in octal, and are
               modified by your process's current umask.  The
               umask value is a number representing disabled
               permissions bits--if your umask were 027 (group
               can't write; others can't read, write, or
               execute), then passing sysopen() 0666 would create
               a file with mode 0640 (0666 &~ 027 is 0640).



On Thu, 21 Oct 1999, Tran Forsythe wrote:

> Date: Thu, 21 Oct 1999 23:28:27 -0700
> From: Tran Forsythe <forsythe at primenet.com>
> Reply-To: phoenix-pm-list at happyfunball.pm.org
> To: phoenix-pm-list at happyfunball.pm.org
> Subject: Re: Phoenix.pm: dumb question
> 
> 
> Hmm.. umask only blocks permissions, it never assigns them.  I think there's
> a global umask out there somewhere - anyone with *longing sigh* Unix correct
> me if I'm wrong?  Anyhow, if I'm not, you may just be able to disable that
> and have 0777 as your default permissions then.
> 
> Otherwise, my suggestion (nasty as it may be) is to cron a chmod -R
> 
> Luck,
> -Kurt
> 
> ------
> 
> "Push to test."
> <click>
> "Release to detonate."
> -Brad Morrison
> 
> ----- Original Message -----
> From: Glen G. Walker <coyotl at primenet.com>
> To: <phoenix-pm-list at happyfunball.pm.org>
> Sent: Thursday, October 21, 1999 12:12 PM
> Subject: Phoenix.pm: dumb question
> 
> 
> 
> OK, so I have an updater that writes files to a folder. On the old server,
> we did something kinky so the new files would write with permissions of
> -rwxrwxrwx when created into the various folders. I am trying to figure
> out how to set up the directories to just automatically change permissions
> to files written to them and have gotten nowhere with the man files for
> chmod or umask.
> 
> Any suggestions?
> 
> ----------------------------------------------------------------------------
> ---
> Glen G. Walker,  coyotl at primenet.com
> www.primenet.com/~coyotl
> ----------------------------------------------------------------------------
> ---
> 
> 
> 




More information about the Phoenix-pm mailing list