• 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
CFURLGetFSRef vs. FSPathMakeRef
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CFURLGetFSRef vs. FSPathMakeRef


  • Subject: CFURLGetFSRef vs. FSPathMakeRef
  • From: Dominic Yu <email@hidden>
  • Date: Tue, 5 Jul 2005 14:07:53 -0700

This might not seem like a Cocoa question, but it has to do with
resolving aliases as described in the Cocoa docs:

<http://developer.apple.com/documentation/Cocoa/Conceptual/LowLevelFileMgmt/Tasks/ResolvingAliases.html>

Here, it recommends using CFURLCreateWithFileSystemPath and then
CFURLGetFSRef to get an FSRef: "To resolve aliases in a path contained
in an NSString, you need to first convert the string to a URL, convert
the URL to an FSRef, resolve the alias, and reverse the series of
conversions to yield another NSString."

However, it seems you can just use FSPathMakeRef and avoid having to
create/release the urls altogether:

OSErr err = FSPathMakeRef([picturePath fileSystemRepresentation],&pictRef,NULL);
etc.

Does using URLs have an advantage or avoid problems that I'm not aware of?

-Dominic
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Predicate Builder & Fetched Properties
  • Next by Date: Re: Predicate Builder & Fetched Properties
  • Previous by thread: Re: Multi-User using Core Data?
  • Next by thread: Catching system-level exceptions with NS_DURING
  • Index(es):
    • Date
    • Thread