Re: FindFolder() and Cocoa
Re: FindFolder() and Cocoa
- Subject: Re: FindFolder() and Cocoa
- From: Daniel Jalkut <email@hidden>
- Date: Tue, 28 Jan 2003 07:25:47 -0800
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/
Programmin
gTopics/LowLevelFileMgmt/Tasks/LocatingDirectories.html
Apple's documentation mentions FSFindFolder() on the same page. Is
there any
reason to prefer one over the other ?
Probably just depends on how you're "used to getting things done".
Being more familiar with FindFolder, I will speak to some of its
advantages/differences. I'm sure the traditional NS "way" has some
good ones, too. FindFolder is much more specific about what directory
in particular you are looking for (I mean, there are simply many more
"constants" defined for passing to FindFolder). So for those who are
concerned with not "hard-coding" a path, the FindFolder approach can
eliminate almost of all of that for even some of the lesser used folder
types. Take a look in Folders.h (CoreServices) for a listing of what's
available.
You can use FindFolder to find some folders within the configured
"Classic" Mac OS 9 folder ("classic domain"). As far as I know it's
the only API which provides a service like that.
Finally FindFolder has an option for creating the folder if it doesn't
exist, and upon creating certain folders, will make certain adjustments
to them (make them invisible, change permissions, etc) as appropriate
for the folder type.. As far as I know the NS API is purely
exploratory (probably for the best, IMO).
Daniel
_______________________________________________
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.