Minor problem with uppercase during overwrite

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Valentino
Power Member
Power Member
Posts: 706
Joined: 2003-02-07, 00:21 UTC
Location: Ukraine

Minor problem with uppercase during overwrite

Post by *Valentino »

I have the following files:
d:\Dir1\AbcDefg.txt
d:\Dir2\ABCDEFG.TXT
I copy second to first and get the following confirmation:
Overwrite:
d:\Dir1\ABCDEFG.TXT
2 bytes, 12.08.2015 10:00:00

With file:
d:\Dir2\ABCDEFG.TXT
3 bytes, 12.08.2015 10:30:20
I expect to see exact file names:
Overwrite:
d:\Dir1\AbcDefg.txt
2 bytes, 12.08.2015 10:00:00

With file:
d:\Dir2\ABCDEFG.TXT
3 bytes, 12.08.2015 10:30:20
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48104
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The problem is that when TC calls FindFirstFile to check for existance of target file, Windows will return the name exactly as asked (=source name), not as on disk (target name) because Windows is case insensitive.
Author of Total Commander
https://www.ghisler.com
User avatar
Valentino
Power Member
Power Member
Posts: 706
Joined: 2003-02-07, 00:21 UTC
Location: Ukraine

Post by *Valentino »

Yes, I understand but anyway this can be fixed.
You check existence by FindFirstFile (or whatever method you want), but compose the message based on a real file name.
User avatar
Valentino
Power Member
Power Member
Posts: 706
Joined: 2003-02-07, 00:21 UTC
Location: Ukraine

Post by *Valentino »

Explanation: this is important when you work on Windows and Linux/Unix and sometimes such minor issues are important or at least distract attention.
For example, on Ubuntu there are many include files with different case, which are treated the same on Windows:
/usr/include/linux/netfilter/xt_connmark.h
/usr/include/linux/netfilter/xt_CONNMARK.h
and above mentioned Overwrite confirmation is confusing and requires extra time for manual investigation in separate Total Commander instance to find out which overwrites what.
Last edited by Valentino on 2015-08-12, 12:57 UTC, edited 1 time in total.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I've tested it: if I call FindFirstFile and pass full path to a file, cFileName member of WIN32_FIND_DATA structure will contain filename in correct case, just as is, not as I've passed it to the function.
User avatar
Valentino
Power Member
Power Member
Posts: 706
Joined: 2003-02-07, 00:21 UTC
Location: Ukraine

Post by *Valentino »

Good news. So this can be easily fixed.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48104
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Strange, it didn't work here. I will check this after the release of TC 8.52.
Author of Total Commander
https://www.ghisler.com
User avatar
Valentino
Power Member
Power Member
Posts: 706
Joined: 2003-02-07, 00:21 UTC
Location: Ukraine

Post by *Valentino »

I also checked: on Windows 7 x64 FindFirstFile works as MVV described. cFileName contains correct case even without full path (with preceding call to SetCurrentDirectory).
Maybe on other OS it works differently? Or maybe you do not call pure Win API but some wrapper layer?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48104
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This should be fixed in TC 8.52 RC1, please test it! I was already calling FindFirstFile, but only using the size and time, not the different name.
Author of Total Commander
https://www.ghisler.com
User avatar
Valentino
Power Member
Power Member
Posts: 706
Joined: 2003-02-07, 00:21 UTC
Location: Ukraine

Post by *Valentino »

Fixed in RC1, thanks!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48104
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks!
Author of Total Commander
https://www.ghisler.com
Post Reply