Re: Two questions
Re: Two questions
- Subject: Re: Two questions
- From: David Adalsteinsson <email@hidden>
- Date: Sun, 27 May 2001 13:37:17 -0400
For one app that I am working on, I have to use a Carbon call that
doesn't exist in Cocoa. Is there something that will convert a file
path NSString like I get from an NSOpenPanel to an FSRef? If there is
such a thing, could you also tell me what header the call is in?
FSSpec mySpec;
FSRef pathRef;
OSStatus status;
OSErr err
BOOL IsDirectory = NO;
// Construct the FSRef
status = FSPathMakeRef([fileName cString],&pathRef,&IsDirectory);
if (status==fnfErr) {
.....
}
// Convert FSRef to FSSpec if needed
err = FSGetCatalogInfo(&pathRef, kFSCatInfoNone, NULL, NULL,
&mySpec, NULL);
if (err) {
....
}