Fun with File/Directory Owners
Fun with File/Directory Owners
- Subject: Fun with File/Directory Owners
- From: m <email@hidden>
- Date: Sun, 16 Mar 2003 00:48:54 +0000
I'm working on an app that downloads a reference file (a pdf) as part
of its first run. Currently, I create a directory to hold this file at
~/Library/Application Support/MyApp.
It has been suggested to me that a better place for this file would be
in /Library/MyApp. That way, multiple users could access the same pdf
and therefore avoid redundantly downloading file. Fair enough.
The problem is that the app support folder created by my app is owned
by the user running my app at the time the folder is created. This
means that if, for whatever reason, a different user would like to
delete the pdf, (to force it be downloaded again, for example), that
user is out of luck.
It looks like I can avoid this problem by creating my app support
folder with an owner of "nobody" and setting the pdf file's owner to
"nobody" as well.
I want to do this in a way that is insensitive to the language of the
system. Presumably, setting the directory's and file's owner account ID
(NSFileOwnerAccountID) is what I want, but I don't know what the ID for
the "nobody" user is. Suggestions?
_murat
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.