• 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: Accessing carbon calls from within cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing carbon calls from within cocoa


  • Subject: Re: Accessing carbon calls from within cocoa
  • From: Nathan Day <email@hidden>
  • Date: Sun, 30 Dec 2001 02:34:26 +1030

I don't think there is a way to get a FSSpec directly in Cocoa. You can though use Carbon to get a FSRef by using

OSStatus FSPathMakeRef ( const UInt8 *path, FSRef * ref, Boolean * isDirectory );

if you have a string path or if you have a NSURL you can use

Boolean CFURLGetFSRef ( CFURLRef url, FSRef *fsRef );

(NSURL *) can be cast as a CFURLRef, you can then do a lot with just a FSRef but if you need a FSSpec you can use

OSErr FSGetCatalogInfo ( const FSRef *ref, kFSCatInfoNone, NULL, NULL, FSSpec * fsSpec, NULL );

On Friday, December 28, 2001, at 12:30 AM, Jaime Rios wrote:

I am working on a project where I need to take a url path passed to me by the NSOpenPanel dialog box and convert that to a fsspec. Is there something in cocoa that will do this, or will I have to take the MoreFiles example from apple and mold it to my needs? Thanks in advance!


  • Prev by Date: Re: Cursor tracking rects
  • Next by Date: Re: Dumb NSImageView Question
  • Previous by thread: Accessing carbon calls from within cocoa
  • Next by thread: menubar rect
  • Index(es):
    • Date
    • Thread