Re: Fast NSArray compare
Re: Fast NSArray compare
- Subject: Re: Fast NSArray compare
- From: Charles Srstka <email@hidden>
- Date: Tue, 15 Apr 2014 16:56:08 -0500
On Apr 14, 2014, at 9:01 PM, Ken Thomases <email@hidden> wrote:
> You should obtain the resource identifier object of each URL using -getResourceValue:forKey:error: with NSURLFileResourceIdentifierKey, then compare those two objects using -isEqual:.
One thing to watch out for, though: the object returned for NSURLFileResourceIdentifierKey returns YES for isEqual: if the two objects have the same inode. This means that if you have two files that are hard links of the same inode, it will report them as equal. If you want to check if two URLs point to the same catalog node rather than to the same inode, you'll need to do something else.
Charles
_______________________________________________
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