Re: CFPreferences and init.
Re: CFPreferences and init.
- Subject: Re: CFPreferences and init.
- From: "Adam R. Maxwell" <email@hidden>
- Date: Sun, 26 Oct 2008 16:46:10 -0700
On Oct 26, 2008, at 4:23 PM, Adam Penny wrote:
That's the binary plist representation. This will be transparent to
well-behaved applications. Naughty ones will try to read the raw XML
plist representation and fail, but ones that use the plist
serialization API won't know the difference.
So from that, do I gather that the binary is the preferred standard
for plists?
Presently it appears to be, but Apple has changed that in the past, so
don't rely on it...
I'll probably show myself up to be barmy with my next revelation,
but this preference panel actually started off to set the
preferences for an automatically triggered Ruby command line script
that I wrote for waking up hosts that share printers automatically
when a print job is sent to the printer in question. I built that to
read its preferences from an apple XML type plist file. At a future
date, I'd like to rewrite that as an objective-c command line
utility, but for the moment Is there any way I can coerce
CFPreferences to synchronize as XML rather than binary? As the
script will be the only thing referring to the plist for the moment
I'm not too worried about other 'naughty' applications! :-)
A couple of suggestions that you may not have considered:
1) if you use /usr/bin/defaults in your Ruby script, you can read/
write the preference file and ignore the plist format.
2) avoid the preference system entirely by writing your plist
somewhere else, such as the Library/Application Support hierarchy.
You can then read/write the plist using NSPropertyListSerialization,
which allows you to specify XML format.
hth,
Adam
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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