[cvsnt] Case Sensitivity when Migrating from UNIX to Windows
Anthony Williams
anthony_w.geo at yahoo.com
Thu Apr 15 12:33:23 BST 2004
"Peter Crowther" <Peter.Crowther at melandra.com> writes:
>> From: Jake Hughes [mailto:jhughes at accentopto.com]
>> I am not aware of any way
>> to add case sensitivity to Windows 2003, but I wanted to put
>> the question to the group hoping somone else has come across this.
>
> NTFS preserves case but is case-insensitive. This is wired in a long
> way down the filesystem code, and I'm not aware of any ways of changing
> it. FAT16 and FAT32 long filenames have the same property, plus it's
> not advised to run CVSNT (or, in my opinion, anything else!) on them.
>
> I think you're out of luck, Jake - unless you want to modify the CVSNT
> code to do something really screwy like mangle names on the way into and
> out of the repository. Cheaper and more reliable to rename the files...
You can open a file with POSIX naming set (pass FILE_FLAG_POSIX_SEMANTICS to
CreateFile) to allow case-sensitive file naming on NTFS.
However, if you have two files with names differing only in case, then you
need to use tools that support POSIX naming for all accesses, otherwise you
will *always* access the file that is first in the directory, even if you
specify the exact filename of another.
To delete a file with a name that differs only in case from another file you
can't use DeleteFile, as that doesn't support case-sensitive naming. Instead,
you need to use CreateFile with the FILE_FLAG_POSIX_SEMANTICS and
FILE_FLAG_DELETE_ON_CLOSE flags set, and then close the handle.
To rename a file, you have to create a hard link with the new name, and then
delete the old file.
Anthony
--
Anthony Williams
Senior Software Engineer, Beran Instruments Ltd.
More information about the cvsnt
mailing list