Re: Properly comparing file NSURLs for equality?
Re: Properly comparing file NSURLs for equality?
- Subject: Re: Properly comparing file NSURLs for equality?
- From: Ken Thomases <email@hidden>
- Date: Fri, 27 May 2011 21:53:05 -0500
On May 27, 2011, at 7:51 PM, Sean McBride wrote:
> That's perfect! But for, shall we say, older cats :), would be next best thing be CFURLGetFSRef() & FSCompareFSRefs()?
We just had another thread about this subject. For pre-10.6, yes, I think that FSCompareFSRefs() is good. For 10.6, I believe you can convert the URLs to file-reference URLs and then compare with -isEqual:.
I also mentioned that one can use NSFileManager to get the attributes and compare both NSFileDeviceIdentifier and NSFileSystemFileNumber, which is basically equivalent to the earlier suggestion to use lstat() and compare st_dev and st_ino.
Apparently, the NSURLFileResourceIdentifierKey/kCFURLFileResourceIdentifierKey suggestion comes to us from the future. ;)
Cheers,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden