CFURLGetFSRef vs. FSPathMakeRef
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