In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (John Delacour) 

> Can someone please tell me if there's any reason not to write files 
> in /private/tmp rather than in /tmp/501/TemporaryItems ?
> drwxrwxrwt   29 root  wheel   986 18 Jan 21:49 tmp
> drwxr-xr-x   13 jd    wheel   442 18 Jan 21:30 TemporaryItems
> So far as jd and admin there's never been a problem, but would there 
> be a problem if I were a user with fewer privileges?

/tmp/501/TemporaryItems/ is your personal temporary items folder.  Witness:

$ perl -MMac::Files -le '
  print FindFolder(kOnSystemDisk, kTemporaryFolderType)'

$ sudo -u maintenance perl -MMac::Files -le '
  print FindFolder(kOnSystemDisk, kTemporaryFolderType, kCreateFolder)'

$ sudo -u guestuser perl -MMac::Files -le '
  print FindFolder(kOnSystemDisk, kTemporaryFolderType, kCreateFolder)'

So when Mac apps use the standard Mac OS API to create temp files, that's 
the path they get, and if you want to restrict temp files to a particular 
user, then feel free to do the same.  Of course, you don't necessarily need 
to use Mac::Files and FindFolder, you can probably create the path yourself, 
though I wouldn't recommend that personally.

See man Mac::Files for details, or point your browser to:


See especially "FindFolder" under Functions, and "Folder Type Constants" and 
"Disk and Domain Constants" under Constants.

Chris Nandor                      [EMAIL PROTECTED]
Open Source Development Network    [EMAIL PROTECTED]

Reply via email to