Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing carbon calls from within cocoa



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!




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.