Re: Application, Home, ... Folders
Re: Application, Home, ... Folders
- Subject: Re: Application, Home, ... Folders
- From: Will Cosgrove <email@hidden>
- Date: Thu, 25 Apr 2002 09:51:44 -0500
Hi All,
This was just covered on the Omni dev list, and I think the best way is to
use Carbon's find folder, which will find the folder even on localized
versions of OS X. How to find the user's application support folder is like
this:
FSRef folder;
OSErr err = noErr;
NSURL *pathURL;
NSString *path;
err = FSFindFolder(kUserDomain, kApplicationSupportFolderType, false,
&folder);
if(err == noErr)
{
(CFURLRef)pathURL = CFURLCreateFromFSRef(kCFAllocatorSystemDefault,
&folder);
path = [NSString stringWithString:[pathURL path]];
}
You can search on the user domain, system domain, and others as well as you
can search for all major folder types.
Cheers,
Will C.
>
I would like to know if it is possible to retrieve the full paths
>
of the "Applications", "Home", "Pictures", etc, folders in Cocoa.
>
>
Is there a way to get these informations ?
>
>
Thank you very much in advance.
_______________________________________________
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.