Skip navigation.
 
mlRe: FindFolder() and Cocoa
FROM : chris corbell
DATE : Tue Jan 28 21:07:22 2003

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_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlFindFolder() and Cocoa chris corbell Jan 27, 19:37
mlRe: FindFolder() and Cocoa Douglas Davidson Jan 27, 20:31
mlRe: FindFolder() and Cocoa Finlay Dobbie Jan 27, 20:46
mlRe: FindFolder() and Cocoa Erik M. Buck Jan 27, 23:26
mlRe: FindFolder() and Cocoa Daniel Jalkut Jan 28, 16:25
mlRe: FindFolder() and Cocoa chris corbell Jan 28, 21:07
mlRe: FindFolder() and Cocoa Daniel Jalkut Jan 31, 04:43