• 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
Re: FSSpec for saving a movie with FlattenMovieData() from an NSString*?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FSSpec for saving a movie with FlattenMovieData() from an NSString*?


  • Subject: Re: FSSpec for saving a movie with FlattenMovieData() from an NSString*?
  • From: "Timothy J. Wood" <email@hidden>
  • Date: Sun, 21 Apr 2002 23:08:57 -0700

On Sunday, April 21, 2002, at 10:22 PM, Michael B. Johnson wrote:
[...[
I can't figure out how to go from @"/tmp/foo.mov" to an FSSpec that it likes.
[...]
NSURL *fileUrl = [NSURL fileURLWithPath:fileName];
FSSpec fileFSSpec;
FSRef fileFSRef;

// get an FSRef for our file
Boolean gotFSRef = CFURLGetFSRef((CFURLRef)fileUrl, &fileFSRef);
// get an FSSpec for the same file
status = FSGetCatalogInfo(&fileFSRef, kFSCatInfoNone, NULL, NULL, &fileFSSpec, NULL);

This looks right to me. We have some working code in OmniFoundation/OFCodeFragment (and similar code a couple other places in our frameworks) that does:

CFURLRef url;
FSRef fsRef;
FSSpec fsSpec;
OSErr err;
Boolean success;

path = [aPath copy];

url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (CFStringRef)path, kCFURLPOSIXPathStyle, false);
success = CFURLGetFSRef(url, &fsRef);
CFRelease(url);
if (!success) {
...
}

err = FSGetCatalogInfo(&fsRef, kFSCatInfoNone, NULL, NULL, &fsSpec, NULL);
if (err != noErr) {
...
}


... and then proceeds to use the fsSpec to open a code fragment.

So, maybe the problem is some subtle difference between +[NSURL fileURLWithPath:] and CFURLCreateWithFileSystemPath() or perhaps you are getting a valid FSSpec and something is going wrong after that point.

-tim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: FSSpec for saving a movie with FlattenMovieData() from an NSString*?
      • From: Aki Inoue <email@hidden>
References: 
 >FSSpec for saving a movie with FlattenMovieData() from an NSString*? (From: "Michael B. Johnson" <email@hidden>)

  • Prev by Date: Re: << do not localize >>
  • Next by Date: Re: Print margins problem
  • Previous by thread: FSSpec for saving a movie with FlattenMovieData() from an NSString*?
  • Next by thread: Re: FSSpec for saving a movie with FlattenMovieData() from an NSString*?
  • Index(es):
    • Date
    • Thread