Just curious.

Does anyone know why filenames/directories are case insensitive?
That really limits the number of name possibilities.

Did the early keyboards not have a Caps Lock key?

Andy
Posted on 2009-10-09 08:08:37 by skywalker
I'd like to flip the coin: why should they be case sensitive?

I haven't been able to think of one good reason you might want case insensitivity on path names, but it can cause a lot of headaches.
Posted on 2009-10-09 08:21:35 by f0dder
There are no decent reasons for case sensitivity and case INsensitivity is somewhat more idiot-resistant. Maybe that's why.
Posted on 2009-10-09 08:34:21 by ti_mo_n
File names under Windows can be case-sensitive, just follow the following rules:
1. REG_DWORD ObCaseInsensitive in "\CurrentControlSet\Control\Session Manager\kernel" key must be zero
2. Use FILE_FLAG_POSIX_SEMANTICS flag in a call to CreateFile to enable posix rules.

When ObCaseInsensitive is 1 (default) on XP, you'll be unable to create blah.txt and BLAH.txt. After you change it to 0, you need to restart the system, to apply.
Posted on 2009-10-09 09:36:35 by sapero
sapero: it's possible to do, but it's a really bad idea since you'll break just about any normal windows app that deals with filenames :)
Posted on 2009-10-09 09:39:26 by f0dder

File names under Windows can be case-sensitive, just follow the following rules:
1. REG_DWORD ObCaseInsensitive in "\CurrentControlSet\Control\Session Manager\kernel" key must be zero
2. Use FILE_FLAG_POSIX_SEMANTICS flag in a call to CreateFile to enable posix rules.

When ObCaseInsensitive is 1 (default) on XP, you'll be unable to create blah.txt and BLAH.txt. After you change it to 0, you need to restart the system, to apply.


Thanks sapero.

I want to make sure I understand this statement.

Does it mean that if I create a file using POSIX rules, then the file won't be accessable at all or only if it is not named exactly?

Thanks.

Access will occur according to POSIX rules. This includes allowing multiple files with names, differing only in case, for file systems that support that naming. Use care when using this option, because files created with this flag may not be accessible by applications that are written for MS-DOS or 16-bit Windows.
Posted on 2009-10-09 13:10:24 by skywalker

File names under Windows can be case-sensitive, just follow the following rules:
1. REG_DWORD ObCaseInsensitive in "\CurrentControlSet\Control\Session Manager\kernel" key must be zero
2. Use FILE_FLAG_POSIX_SEMANTICS flag in a call to CreateFile to enable posix rules.

When ObCaseInsensitive is 1 (default) on XP, you'll be unable to create blah.txt and BLAH.txt. After you change it to 0, you need to restart the system, to apply.


I changed the ObCaseInsensitive key.

I created two files with the same name except for a case change in the file name.

Had some wierd stuff occur like files with the same contents even though they should have been different.

Also, windows could not open one file and asked if I wanted to create a new one.

I went back to case insensitive. :-)

Posted on 2009-10-09 15:29:58 by skywalker
This is pretty much what f0dder said :)
Posted on 2009-10-09 16:59:48 by ti_mo_n
I have created one with "asdf" and another with "qwert" (4 and 5 bytes). After deleting one with explorer, both were deleted. Hitting F3 (preview) in totalcommander - only the newest, with 5 bytes was opened. Same with notepad.

So I think, to work with such files, the user interface should use FILE_FLAG_POSIX_SEMANTICS flag with CreateFile, but noone uses it. This flag can be 'forced' easily by a plugin dll.
Posted on 2009-10-10 03:45:07 by sapero
"Forcing stuff" and writing a dll changes this to way beyond a simple project.

I just got KMD and having a lot of fun with it.

Up till now, I thought there was no way to directly control the hardware in XP. :-)

Posted on 2009-10-10 17:21:42 by skywalker