Looking at case insensitivity - question

Jens Alfke jens at mooseyard.com
Mon Apr 21 09:39:13 CDT 2008


On 21 Apr '08, at 2:09 AM, Michael Haggerty wrote:

> It seems to me that os.path.normcase() could be used to determine
> whether the filesystem is case-sensitive.
>
>    if os.path.normcase('Aa') == 'Aa':
>        # Filesystem is case-sensitive

Nope; I just tried it on Mac OS X 10.5:
 >>> import os.path
 >>> os.path.normcase('Aa')
'Aa'

The docs say this function "has no effect under POSIX", which would  
include Mac OS X.

Besides, the function itself doesn't make any sense. You can't ask  
about how a filesystem would treat filenames without saying what  
filesystem it is — any OS could have a mixture of case-sensitive and - 
insensitive filesystems mounted at any time. So any such function  
would have to take a real path as a parameter.

—Jens
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1875 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial/attachments/20080421/bbb38866/attachment.bin 


More information about the Mercurial mailing list