Re: URLByResolvingBookmarkData not case sensitive

2015-01-07 Thread Robert Martin
Since the file system is case insensitive, why not store the path in upper or lower case, and convert the path you’re comparing accordingly? When adding new files, I need to make sure the file is not already in the database so I compare the paths. This works well except when the case

Re: URLByResolvingBookmarkData not case sensitive

2015-01-07 Thread Robert Martin
Ignore my previous post - I hadn’t looked at the thread! On Jan 7, 2015, at 8:40 AM, Robert Martin robmar...@frontiernet.net wrote: Since the file system is case insensitive, why not store the path in upper or lower case, and convert the path you’re comparing accordingly? When adding

Re: URLByResolvingBookmarkData not case sensitive

2015-01-07 Thread Ken Thomases
On Jan 6, 2015, at 11:37 PM, Trygve Inda cocoa...@xericdesign.com wrote: On Jan 6, 2015, at 8:43 PM, Trygve Inda cocoa...@xericdesign.com wrote: Ultimately what I need to able to do is compare a bookmark to a path. Why? Or rather, what is the reason underlying that one? I am keeping a

Re: URLByResolvingBookmarkData not case sensitive

2015-01-06 Thread Trygve Inda
On 6 Jan 2015, at 16:25, Trygve Inda cocoa...@xericdesign.com wrote: What then is the best way to do what I need? I am saving a bookmark to a file and later on I need to display the filename associated with that Bookmark. Currently I am getting the path and taking the last component,

Re: URLByResolvingBookmarkData not case sensitive

2015-01-06 Thread Kyle Sluder
On Jan 6, 2015, at 5:05 PM, Trygve Inda cocoa...@xericdesign.com wrote: If I bookmark a file and the case of any folders or the file itself changes, then later when I extract the path from the bookmark I want it to reflect the new case of the path as it now exists. Use -[NSFileManager

Re: URLByResolvingBookmarkData not case sensitive

2015-01-06 Thread Jens Alfke
On Jan 6, 2015, at 8:43 PM, Trygve Inda cocoa...@xericdesign.com wrote: Ultimately what I need to able to do is compare a bookmark to a path. Why? Or rather, what is the reason underlying that one? —Jens ___ Cocoa-dev mailing list

Re: URLByResolvingBookmarkData not case sensitive

2015-01-06 Thread Stephen J. Butler
What about this (caveat: only works if the file exists): @interface NSArray (FileNSURL) - (NSUInteger) indexOfFileNSURL:(NSURL*)aFileURL error:(NSError**)error; @end @implementation NSArray (FileNSURL) - (NSUInteger) indexOfFileNSURL:(NSURL *)aFileURL error:(NSError**)error { id

Re: URLByResolvingBookmarkData not case sensitive

2015-01-06 Thread Trygve Inda
On Jan 6, 2015, at 8:43 PM, Trygve Inda cocoa...@xericdesign.com wrote: Ultimately what I need to able to do is compare a bookmark to a path. Why? Or rather, what is the reason underlying that one? I am keeping a database of files that the user adds to a database. Internally I keep the

Re: URLByResolvingBookmarkData not case sensitive

2015-01-06 Thread Trygve Inda
On Jan 6, 2015, at 7:40 PM, Kyle Sluder k...@ksluder.com wrote: On Jan 6, 2015, at 5:05 PM, Trygve Inda cocoa...@xericdesign.com wrote: If I bookmark a file and the case of any folders or the file itself changes, then later when I extract the path from the bookmark I want it to reflect

Re: URLByResolvingBookmarkData not case sensitive

2015-01-06 Thread Jens Alfke
On Jan 6, 2015, at 9:37 PM, Trygve Inda cocoa...@xericdesign.com wrote: When adding new files, I need to make sure the file is not already in the database so I compare the paths. That's not reliable. Different paths does not mean different files, even without case-folding. There are

Re: URLByResolvingBookmarkData not case sensitive

2015-01-06 Thread Mike Abdullah
On 6 Jan 2015, at 16:25, Trygve Inda cocoa...@xericdesign.com wrote: What then is the best way to do what I need? I am saving a bookmark to a file and later on I need to display the filename associated with that Bookmark. Currently I am getting the path and taking the last component,

Re: URLByResolvingBookmarkData not case sensitive

2015-01-06 Thread Trygve Inda
On 5 Jan 2015, at 10:11 AM, Trygve Inda cocoa...@xericdesign.com wrote: I am using URLByResolvingBookmarkData . If I make a Bookmark to a file: /Volumes/Macintosh HD/Documents/MyFile.txt and later resolve it with URLByResolvingBookmarkData, I get the original path as expected.

Re: URLByResolvingBookmarkData not case sensitive

2015-01-06 Thread Jens Alfke
On Jan 6, 2015, at 8:25 AM, Trygve Inda cocoa...@xericdesign.com wrote: I am saving a bookmark to a file and later on I need to display the filename associated with that Bookmark. You may need to canonicalize the path. The docs for -[NSString stringByStandardizingPath] don't say that it

URLByResolvingBookmarkData not case sensitive

2015-01-05 Thread Trygve Inda
I am using URLByResolvingBookmarkData . If I make a Bookmark to a file: /Volumes/Macintosh HD/Documents/MyFile.txt and later resolve it with URLByResolvingBookmarkData, I get the original path as expected. Then if I change the filename to MYFILE.txt in the Finder and resolve the bookmark

Re: URLByResolvingBookmarkData not case sensitive

2015-01-05 Thread Fritz Anderson
On 5 Jan 2015, at 10:11 AM, Trygve Inda cocoa...@xericdesign.com wrote: I am using URLByResolvingBookmarkData . If I make a Bookmark to a file: /Volumes/Macintosh HD/Documents/MyFile.txt and later resolve it with URLByResolvingBookmarkData, I get the original path as expected.