• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
re: Setting global umask
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: Setting global umask


  • Subject: re: Setting global umask
  • From: email@hidden (Jody Fairchild)
  • Date: Mon, 14 Jan 2002 14:21:11 +0900

in cocoa-dev digest vol 2 #11, rainer wrote:

> Message: 9
> Date: Sun, 13 Jan 2002 20:45:23 -0200
> From: Rainer Brockerhoff <email@hidden>
> Subject: Setting global umask
>
> I need to set the global umask to something other than "022" to get
> custom default permissions for files created by applications and the
> Finder.
>
> I've been unable to find the location for the default umask anywhere in
> "the user's preferences". A search on Google and in the ADC docs also
> failed. Any hints?

typically, if it's set at all, it would be in one of the user's "dot"
files, i.e., ".login", ".tcshrc", ".cshrc", etc. imho, the best place to
put one's umask is the .login file, but that's no guarantee of where anyone
else is going to put it ... note also that you may encounter some parsing
issues, due to conditional stuff, e.g. (from my .login):

# otherwise perl module installs get broken
if ($USER != "root") umask 77

and that of course says nothing of the case (and this is probably the
majority of non-power-users) who have no idea where or what their .login is,
and consequently have no default setting anywhere, other than the system
default, which seems to be 022, as you said (see also:)

/usr/share/init/tcsh/environment

imho, 022 isn't a bad value for most mac users' systems, which probably
aren't going to have much serious multi-user stuff going on. but it's hard
to guess what the user would want, just based on parsing files.

one thing you might consider is temporarily spawning a shell as the user, in
order to read the default umask ... you could do this by running a tiny
shell script which writes its umask value to stdout as an NSTask.

-jf


  • Follow-Ups:
    • Re: Setting global umask
      • From: Tom Harrington <email@hidden>
  • Prev by Date: Re: Password Text Field Formatter
  • Next by Date: Re: Detecting Asian fonts?
  • Previous by thread: Setting global umask
  • Next by thread: Re: Setting global umask
  • Index(es):
    • Date
    • Thread