• 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
help with FSPathMakeRef
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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);

}


  • Follow-Ups:
    • Re: help with FSPathMakeRef
      • From: Aki Inoue <email@hidden>
  • Prev by Date: Re: A niceMessage in MyDocument
  • Next by Date: First questions
  • Previous by thread: Sorry for email problems...
  • Next by thread: Re: help with FSPathMakeRef
  • Index(es):
    • Date
    • Thread