File system case sensitivity
File system case sensitivity
- Subject: File system case sensitivity
- From: Jonathan Fewtrell <email@hidden>
- Date: Sat, 18 Jun 2005 16:30:05 +0100
I know there are several threads on this topic already, but I still can't get my head around the interaction of NSString's path methods and the case sensitivity or insensitivity of the file system.
My app reads third-party data supplied on CD. The CDs are in ISO 9660 format (does this matter?). The files and folders follow a strict naming pattern, and, relying on this, my app uses NSString path methods to find particular files on the CD and copy them to hard disk (HFS+ format). Originally, CDs were supplied with all file and folder names in upper case and I wrote my code accordingly, but I have now found that sometimes lower case is used. I thought (OK, hoped) that, because the OS X file system is case insensitive, my original code would still work. It doesn't. For example:
File on CD used to be named README.TXT. Now it is readme.txt;
cdName is the name of the CD volume;
README and TXT are defined as @"README" and @"TXT" respectively.
A typical bit of my code might be:
NSString *path;
path = [[cdName stringByAppendingPathComponent:README] stringByAppendingPathExtension:TXT];
[[NSFileManager defaultManager] fileExistsAtPath:path] previously returned YES; now it returns NO.
Any guidance on this would be much appreciated. I don't know whether my problem lies with NSString, NSFileManager, the fact that the CD is in ISO 9660 format or a simple misunderstanding on my part of the meaning of 'case insensitive'. I am hoping I don't have to write tons of extra code just to cope with the fact that some CDs are using upper case and some lower.
Jon
_______________________________________________
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