Re: Accessing carbon calls from within cocoa
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!