help with FSPathMakeRef
help with FSPathMakeRef
- Subject: help with FSPathMakeRef
- From: Gonzalo Castro <email@hidden>
- Date: Thu, 21 Jun 2001 17:37:00 -0400
I'm trying to convert a pathname to an FSSpec so I can later call
the QT api CreateMovieFile which requires an FSSpec.
I'm using the NSSting to FSSpec conversion code from this list's
archives. However, the file in question doesn't exist yet and so I
get -43 error code returned from FSPathMakeRef _and_ it doesn't
give back anything in 'ref'. When I create the file before running
this code FSPathMakeRef returns noErr with (I think) a valid ref,
and the next call (FSGetCatalogInfo) returns noErr with a valid FSSpec.
What am I doing wrong? How can I get an FSSpec of a file-to-be?
Thanks for any help.
NSSavePanel *sp;
FSSpec fileSpec;
FSRef ref;
int spResult;
OSStatus status;
sp = [NSSavePanel savePanel];
[sp setRequiredFileType:@"mov"];
spResult = [sp runModalForDirectory:NSHomeDirectory() file:""];
if (spResult == NSOKButton)
{
// I need to make some QT api calls that require an FSSpec so I
// attempt to convert the path to an FSSpec...
status = FSPathMakeRef[[sp filename] fileSystemRepresentation],
&ref, NULL);
status = FSGetCatalogInfo(&ref, kFSCatInfoNone, NULL, NULL,
&fileSpec, NULL);
}