Re: Application information that all users can see
Re: Application information that all users can see
- Subject: Re: Application information that all users can see
- From: Uli Kusterer <email@hidden>
- Date: Wed, 31 Jan 2007 23:55:40 +0100
Am 29.01.2007 um 16:11 schrieb David Brennan:
I want to add a counter for every time my app has been started. My app
is running in Cocoa, and I tried keeping this counter in the user
preferences using NSUserDefaults, but this will only work if there is
only one user.
How should I do this in Cocoa.
That's a little hairy. There's really no reliable place that your
app can write to that every user can access. The app is run as the
current user, which can only access its own files (that's a security
measure). What you'd need to do would be to make your application
install a so-called setuid-helper-tool, i.e. a small application that
increases your counter that gets run as root or another privileged
user, so it can access some central location where you keep this info.
Hmmm... or maybe you could just try writing a file containing your
counter to /Users/Shared?
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden