File commands and case sensitivity

Started by etippelt, November 20, 2018, 07:16:25 AM

Previous topic - Next topic

etippelt

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
Using Winbatch since 1995. Excellent tool, awesome support always.

td

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.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

ChuckC

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.

td

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.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade