• 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
Cross-user and cross-process shared settings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cross-user and cross-process shared settings


  • Subject: Cross-user and cross-process shared settings
  • From: Dave DeLong <email@hidden>
  • Date: Wed, 26 Aug 2009 15:51:09 -0600

Hi everyone,

I have two processes - a user process and a root-level LaunchDaemon. I'd like both processes to have shared settings. I've tried getting this to work via a sqlite database, but have run into corruption issues. I've thought about using NSUserDefaults, but the NSGlobalDomain seems to only be global for the user, and I need a cross-user persistent domain, which NSUserDefaults doesn't seem to provide.

I've tried reading and writing an XML file directly, and I can get this to work fine with multiple threads (via a simple NSLock), but when I attempt to apply an O_EXLOCK to the file to prevent one process from writing to the file while the other is, but it doesn't seem to be working.

CFPreferences seems to have most of the same issues as NSUserDefaults. There is a "kCFPreferencesAnyUser" constant, but the documentation says that I can only use that if I have admin privileges (which the user process does not have).

So my question is this:

How can I effectively implement cross-process and cross-user shared settings?

Thanks,

Dave
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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


  • Follow-Ups:
    • Re: Cross-user and cross-process shared settings
      • From: Ken Thomases <email@hidden>
    • Re: Cross-user and cross-process shared settings
      • From: Dave Keck <email@hidden>
  • Prev by Date: Making failed NSAsserts crash an app
  • Next by Date: Re: QLGenerator PLUGIN_ID [SOLVED]
  • Previous by thread: Re: Making failed NSAsserts crash an app
  • Next by thread: Re: Cross-user and cross-process shared settings
  • Index(es):
    • Date
    • Thread