Re: best way to save document level settings?
Re: best way to save document level settings?
- Subject: Re: best way to save document level settings?
- From: Randall Wood <email@hidden>
- Date: Tue, 9 Dec 2003 10:22:03 -0500
On Tuesday, December 9, 2003, at 02:32 AM, Donald Hall wrote:
>
My thanks to everyone who replied. I am looking into using
>
NDResourceFork as it seems the logical place to put this information
>
is with the document itself. Any solution I can think of using the
>
program's preference .plist gets messy quickly if you want to keep
>
track of the existence of the document files so as not to be carrying
>
around information on deleted documents in the .plist file.
>
>
What happens if the user is not using the HFS+ file system?
A second file named ._filename.extension is created in the directory
containing the file on non-HFS+ file systems (I think--it could be a
directory containing a single file for each fork other than the data
fork), but if there are file systems that do not support filenames
beginning with '.', I don't know how that situation is handled. I do
know however, that on non-HFS+ file systems it is really easy to lose
or misplace the resource fork if any BSD tools or applications that are
not resource fork aware touch the document.
Also note that, unless you are careful, if the document is to be shared
by multiple users, one user's preferences can wipe out another user's
preferences if the preferences are within any fork of the document
itself.
Here are three other suggestions:
1) if your document is a bundle (like .pbproj or .rtfd documents) or
can be stored as a bundle (like OpenOffice.org or StarOffice documents
(they are zipped directories)), you may want to store user's
preferences in a .plist within the bundle.
2) if your document is a serialized data structure, store the
preferences within the document itself.
3) store a user's per-document preferences in ~/Library/Application
Support/Your Application Name/ using some key stored inside the
document to reference the preferences set. Your preferences set should
be small enough so that most of your users will not have problems with
the disk filling with gobs of small documents as well.
>
Thanks again,
>
>
Don
>
>
On Dec 6, 2003, at 2:39 AM, Donald Hall wrote:
>
>
> My application displays document data in tables that can be sorted by
>
> column like iTunes or the Finder list view. I want to save the
>
> sorting columns and sorting directions of the tables when the
>
> document is closed and saved. What is the best way to save this
>
> information? At present, I am thinking of using the program's .plist
>
> file, with one entry (a dictionary) for each document the user saves.
>
> The plist key would be the document's file path. The total number of
>
> documents is not likely to be large. The only other alternative I can
>
> think of is to save the information in the document itself, but the
>
> sorting information really has nothing to do with the actual data in
>
> the file and it would mean changing another program that reads the
>
> data file to ignore it.
>
>
>
> Thanks for any suggestions or insights,
--
Randall Wood
email@hidden
"The rules are simple: The ball is round. The game lasts 90 minutes.
All the rest is just philosophy."
[demime 0.98b removed an attachment of type application/pgp-signature which had a name of PGP.sig]
_______________________________________________
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.