On Thursday, June 5, 2003, at 01:11 AM, Michael G Schwern wrote:


On Wed, Jun 04, 2003 at 10:23:58AM -0500, Ken Williams wrote:
Well, your technique of reading the entire directory just to get the
proper-case name of a single file is no Cat Pajama Suit either.

The only real way to handle it properly if you have no advance
knowledge of the filesystem is to query the OS for the proper casing.
Mac OS X has this ability, it's probably available in other
case-insensitive case-preserving environments too if we wanted to
bother with it.

A far simpler thing to do is just write out a mixed-case filename and
see what you get back from readdir() to test for case preservation. For
case sensitivity, just write out a filename and try to open it with a
different casing.

Oh, you're describing how to determine how the current system deals with cases. I was describing how to determine the casing of a file when you already know you're on a case-insensitive, case-preserving FS.


-Ken



Reply via email to