Re: Properly comparing file NSURLs for equality?
Re: Properly comparing file NSURLs for equality?
- Subject: Re: Properly comparing file NSURLs for equality?
- From: Peter Lübke <email@hidden>
- Date: Sat, 28 May 2011 01:38:35 +0200
[ [someURL absoluteURL] isEqual:[otherURL absoluteURL]] should return
correct results.
Cheers,
Peter
Am 28.05.2011 um 01:13 schrieb Sean McBride:
Hi all,
What is the correct way to test if two NSURLs refer to the same file
system object?
I've just learnt the hard way that one can have two URLs that refer to
the same file system object but because they are subtly different,
isEqual: returns NO:
ex:
<file://localhost/Volumes/Disk/Users>
vs
<file:///Volumes/Disk/Users>
isEqual: returns NO. I guess this makes some sense, but it's not the
kind of equality I'm looking for.
What would best practice be? Convert to full path, and compare those?
Note: I'm not concerned about resolving symlinks or aliases.
(Aside: I was surprised to see that there is no isEqualToURL:,
analogous
to isEqualToString, isEqualToSet, etc. I wonder why...)
Thanks,
--
_______________________________________________
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