• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Application, Home, ... Folders
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Application, Home, ... Folders
      • From: Vince DeMarco <email@hidden>
  • Prev by Date: Re: NSTextView and First Responder
  • Next by Date: Re: ioctl
  • Previous by thread: Re: Application, Home, ... folders
  • Next by thread: Re: Application, Home, ... Folders
  • Index(es):
    • Date
    • Thread