Users/Shared

Oldtimer
Posts: 834
Joined: 2002.09
Post: #1
I've recently recieved a crash report on Galder when creating the high score file. I want to share high scores and registration status across all local users, so I naïvely put them in /Library, but it turns out that it's possible to not have write access there. I've scouted around for something to replace it, and found /Users/Shared.

What's the status on this? Is it always in place on fresh systems? Usually writeable? Generally wise to use? Any other globally writeable directory?

Thanks,
Quote this message in a reply
Moderator
Posts: 623
Joined: 2007.09
Post: #2
I've had it on every single OS X install I've done, ranging from 10.1 to 10.3.7 to 10.3.9 to 10.4 to 10.4.4 to 10.4.6 to 10.4.10 to 10.5.

And yes, they were all clean installs except for 10.3.9.

I can't tell you how wise to use, as I am obviously a relatively old newbie to programming, but GarageBand writes it's demo songs to that folder, so I can't see why it wouldn't work.

- LG

- Lincoln Green
http://www.binkworks.com/
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #3
Blizzard puts their preferences there. I imagine they know what they're doing.
Quote this message in a reply
Oldtimer
Posts: 834
Joined: 2002.09
Post: #4
Excellent! Thanks for the input, I'll go that route.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #5
Yes, it always exists, and should always be writable (but remember to fail gracefully if it's not Wink )
Quote this message in a reply
Moderator
Posts: 623
Joined: 2007.09
Post: #6
Yeah, something like Matt Gemmels error would be nice,

KABOOM

Not to worry you or anything, but this app just went straight to hell in a handbasket.

Don't show this message again.

Rasp

-LG

- Lincoln Green
http://www.binkworks.com/
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #7
There was a lengthy discussion about how to handle multi-user prefs / high score sharing on the mac-games-dev list a few months back. Suffice to say no concensus was reached.
Quote this message in a reply
Moderator
Posts: 3,570
Joined: 2003.06
Post: #8
Seems to me that Shared would be a fine place to put them. You might even create a Preferences directory in there so it'd be Users/Shared/Preferences/mygameprefs.plist. A path like that is pretty self-descriptive as to why it's there.
Quote this message in a reply
Moderator
Posts: 770
Joined: 2003.04
Post: #9
I wonder what may happen if I were to create a new user account named "Shared"... Sneaky
Quote this message in a reply
Moderator
Posts: 3,570
Joined: 2003.06
Post: #10
PowerMacX Wrote:I wonder what may happen if I were to create a new user account named "Shared"... Sneaky

So, what happens?
Quote this message in a reply
Moderator
Posts: 770
Joined: 2003.04
Post: #11
I don't have Time Machine (still on Tiger) so I'd rather let someone else try... Wink

Also, shouldn't the preferences be stored in /Users/Shared/Library/Preferences?
Quote this message in a reply
Moderator
Posts: 3,570
Joined: 2003.06
Post: #12
PowerMacX Wrote:I don't have Time Machine (still on Tiger) so I'd rather let someone else try... Wink
Chickin! Rasp

... of course, I'm not gonna try it either ...

Quote:Also, shouldn't the preferences be stored in /Users/Shared/Library/Preferences?

Yeah, sure. Sounds good to me. I just don't know what the point of a library directory being in shared would be, but that doesn't mean it's a bad idea. Certainly fits the standard scheme of things.
Quote this message in a reply
Member
Posts: 201
Joined: 2002.06
Post: #13
http://developer.apple.com/samplecode/CF...index.html

So it seems that the Shared directory is the recommended way to do this.
Quote this message in a reply
Post Reply