• 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
Re: File modification
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File modification


  • Subject: Re: File modification
  • From: Stéphane Sudre <email@hidden>
  • Date: Wed, 26 Mar 2003 11:28:06 +0100

On Wednesday, March 26, 2003, at 10:38 AM, Hamish Allan wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Tuesday, Mar 25, 2003, at 23:28 Europe/London, email@hidden wrote:

Actually I want to use it not for document files, but for communicating preferences between a system prefs pane and a daemon.

Argh!

Why not using an Interprocess communication solution? (BTW it's great to see that there's a dedicated session to IPC during next WWDC)

The preferences are communicated in both directions. The daemon, when started, determines the settings that the user can choose between; the user chooses between them in the preference pane. Both sets of preferences should be persisted (the system preferences app will not always be running for the daemon to query, and the preference pane allows the daemon to be started and stopped but should still allow the user to choose the settings when stopped).

So I'm figuring that there'll have to be two files anyway, and any interprocess communication will be tantamount to "go and re-read your file", which is superfluous if I can receive notification of file modification. But if there's something obviously wrong with my approach I'd like to take advice.

If the daemon can't change any value in the prefs, then maybe you can just do this:

The Daemon reads the Prefs file when it's launched.
The PrefPane reads the Prefs file when it's launched.

When the PrefPane modifies a value, it both writes the modification on disk and send the new values to the daemon if the daemon is running (checking the daemon is running (listening) can be easily done via the CFMessagePort API).
_______________________________________________
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.
References: 
 >Re: File modification (From: Hamish Allan <email@hidden>)

  • Prev by Date: Re: Dragging a file out of an NSTableView
  • Next by Date: Re: [OT] Projects management tools
  • Previous by thread: Re: File modification
  • Next by thread: RE:Send TCP Data ??CurlHandle.framework
  • Index(es):
    • Date
    • Thread