Re: FindFolder() and Cocoa
Re: FindFolder() and Cocoa
- Subject: Re: FindFolder() and Cocoa
- From: chris corbell <email@hidden>
- Date: Tue, 28 Jan 2003 12:07:22 -0800 (PST)
On Monday, January 27, 2003, at 02:26 PM, Erik M. Buck wrote:
>
Is there a problem with NSSearchPathForDirectoriesInDomains() ?
>
>
See
>
http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/ProgrammingTopics/LowLevelFileMgmt/Tasks/LocatingDirectories.html
>
>
Apple's documentation mentions FSFindFolder() on the same page. Is there any
>
reason to prefer one over the other ?
The hitch I ran into which led me to post the question stems
from the fact the FSFindFolder() returns nsvErr if the volume/
domain you request is kUserDomain. For something like the
preferences folder it's OK, you get the user's preferences
folder with kOnAppropriateDisk. However it means there's no
direct way to get the user's ~/Library/Application Support
folder, because kOnAppropriateDisk there gives you the local
machine's /LIbrary/Application Support.
FindFolder() -does- work well with kUserDomain (at
least there's no error and a valid FSSpec can be built).
However if you then try to convert an FSSpec based on
FindFolder's returned values to an FSRef, FSpMakeFSRef()
will again return nsvErr.
I'm now just building hard-coded subpaths based on stems from NSPathUtilities. I hope it's true that using a hard-coded
"Application Support" string will work even in other locales.
Thanks for discussion,
Chris
_______________________________________________
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.