WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: etippelt on November 20, 2018, 07:16:25 AM

Title: File commands and case sensitivity
Post by: etippelt on November 20, 2018, 07:16:25 AM
Good day folks!
I am getting some unexpected results with a bit of code that I've been using since 1995, and I would like to check the case sensitivity of some file commands.

So for example, are FileExist and FileCompare case sensitive when it comes to the actual filename?  If you use FileExist to check for c:\windows\win.ini, will it report the file as found if the file is actually WIN.INI ?

I could not find anything in a past posting here, or in the documentation. Nor can I find an IntControl that says "ignore case".

Any advice welcome!

Thanks
EdT
Title: Re: File commands and case sensitivity
Post by: td on November 20, 2018, 07:25:33 AM
Both FAT32 and NTFS, the two most common Windows file systems, are case insensitive.  This means that all WinBatch file functions do not consider case in file paths, names, and extensions.
Title: Re: File commands and case sensitivity
Post by: ChuckC on November 20, 2018, 10:44:53 AM
Both file systems are also case preservative.  Whatever case you create a directory or file with will be preserved, and any enumeration operation will return it in its original case.  However, all operations that involve opening a handle via the name or looking up a file based on its name are case insensitive.
Title: Re: File commands and case sensitivity
Post by: td on November 21, 2018, 08:04:49 AM
Just to be clear, enumeration operations performed using file masks .e.g. wildcards do not consider text case when matching file paths and/or names to the partial specification of the mask.