Re: Application, Home, ... Folders
Re: Application, Home, ... Folders
- Subject: Re: Application, Home, ... Folders
- From: Vince DeMarco <email@hidden>
- Date: Thu, 25 Apr 2002 10:09:39 -0700
On Thursday, April 25, 2002, at 07:51 AM, Will Cosgrove wrote:
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.
Or use the file NSSystemIncludes.h (its in /usr/include) it has similar stuff.
And will always do the correct thing.
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.
_______________________________________________
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.