• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
File system case sensitivity
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: File system case sensitivity
      • From: Jordan Krushen <email@hidden>
    • Re: File system case sensitivity
      • From: Chris Parker <email@hidden>
    • Re: File system case sensitivity
      • From: Sherm Pendley <email@hidden>
    • Re: File system case sensitivity
      • From: Cameron Hayne <email@hidden>
  • Prev by Date: Re: question about selector as argument
  • Next by Date: Re: question about selector as argument
  • Previous by thread: Re: question about selector as argument
  • Next by thread: Re: File system case sensitivity
  • Index(es):
    • Date
    • Thread