I'm using Kevin Ballard's CFPreferences (thanks, Kevin!), which uses
SwapFile from the CarbonDeclareLibrary. Everything was working
perfectly, and I was able to write a properly formatted preferences
(plist) file to the Preferences folder -- until I changed the name of
my application. Because of the name change, I also changed the name
that I passed to CFPreferences, and that seems to be the problem.
Originally, when my app was working, I was passing
"com.blueflashsoft.Demo" in the New CFPreferences call. Then I
changed it to "com.blueflashsoft.PrefsDemo", and it suddenly stopped
working. I would correctly get a file in my Preferences folder called
"com.blueflashsoft.PrefsDemo.plist", but it was an empty file.
I stepped through the whole thing in the debugger, and discovered
that the problem seems to be the length of the preference file name.
My preferences file is correctly written to the temporary folder, but
SwapFile fails to do the swap if the length of the file name is
greater than 32. Thus, "com.blueflashsoft.Demo.plist" is successfully
written to the Preferences folder, while
"com.blueflashsoft.PrefsDemo.plist" is not.
In fact, if I look at the dest parameter for SwapFile, I see that,
when I specify a name that's too long, the Absolute Path property of
the folderItem looks something like this:
Opus:Users:bgiles:Library:Preferences:com.blueflashsoft.#345CCB.plist
while with a shorter name, I see something like this:
Opus:Users:bgiles:Library:Preferences:com.blueflashsoft.Demo.plist
Is this a bug, or a "feature", and is there a fix, or a workaround?
I know that OS 9 had a 31 character limit on file names, but I'm
running OS X (Panther), and the limit in my application seems to be
32 characters, not 31, so I'm not really sure what's going on here.
Since I have a relatively long domain name, this seems to limit me to
eight-character application names, if I want to use the standard
naming convention for preference files.
Any ideas?
--
Bruce L. Giles, Oak Ridge, TN USA -- <mailto:bruce at blueflashsoft dot com>
- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|