Cannot be solved [TC 10 b4] problems when changing attributes for certain filename on FAT32 drives

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, sheep, Hacker, Stefan2

Post Reply
User avatar
petermad
Power Member
Power Member
Posts: 10330
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Cannot be solved [TC 10 b4] problems when changing attributes for certain filename on FAT32 drives

Post by *petermad »

To reproduce make two files on a FAT32 drive with these names:

Code: Select all

del'ivoire.txt
del’ivoire.txt
The apostrophe in the first filename is the normal U+0027 apostrophe
The apostrophe in the second filename is a Right Single Quotation Mark U+2019 (Alt+0146)

1. In TC place the cursor over the second file.
2. Open the "Change attributes" dialog.
3. Change an attribute or change the date or time and press OK
4. Notice that it is the first file and not the second file that get its attributes changed!
This does not happen with any of these file names:

Code: Select all

del‛ivoire.txt
del´ivoire.txt
del`ivoire.txt
del′ivoire.txt
And it does not happen on a NTFS drive.

It is probably not a TC problem, because Windows Explorer has similar problems with the second file.

Tested under WIndows 7 and 10
Last edited by petermad on 2021-04-09, 18:09 UTC, edited 1 time in total.
License #524 (1994)
Danish Total Commander Translator
TC 9.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (20H2) 64bit, 'Everything' 1.4.1.1005 x64
TC 3.21b2 on Android 6 & 11
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 40779
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 10 b4] problems when changing attributes for certain filename on FAT32 drives

Post by *ghisler(Author) »

This sounds like a bug in the file system. have you tried it on the Windows command line (cmd.exe), e.g.
attrib +r del’ivoire.txt
or
attrib +r "del’ivoire.txt"
?
Author of Total Commander
http://www.ghisler.com
User avatar
Usher
Power Member
Power Member
Posts: 1060
Joined: 2011-03-11, 10:11 UTC

Re: [TC 10 b4] problems when changing attributes for certain filename on FAT32 drives

Post by *Usher »

2ghisler(Author)
The result may depend on codepage used by cmd.
Regards from Poland
Andrzej P. Wozniak
User avatar
petermad
Power Member
Power Member
Posts: 10330
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Re: [TC 10 b4] problems when changing attributes for certain filename on FAT32 drives

Post by *petermad »

This sounds like a bug in the file system. have you tried it on the Windows command line (cmd.exe), e.g.
attrib +r del’ivoire.txt
or
attrib +r "del’ivoire.txt"
?
It is not possible to enter ’ (U+2019) in a DOS box, it gets converted to ' (U+0027) - I have tried both with cp 850, 65000 and 65001 - so it is not possible to change an attribute for del’ivoire.txt in a DOS box
License #524 (1994)
Danish Total Commander Translator
TC 9.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (20H2) 64bit, 'Everything' 1.4.1.1005 x64
TC 3.21b2 on Android 6 & 11
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 40779
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 10 b4] problems when changing attributes for certain filename on FAT32 drives

Post by *ghisler(Author) »

Stange, I have used copy and paste (Ctrl+V works in cmd.exe) and I could paste del’ivoire.txt just fine.

But the bug happens also in cmd.exe:
G:\test>echo . > del’ivoire.txt
G:\test>echo . > del'ivoire.txt
G:\test>attrib +r del’ivoire.txt
dir /AR /B
del'ivoire.txt
/AR tells dir to show files with attribute "R", and /B only the name. As you can see, the attribute was set to the wrong file also by cmd.exe.
This is on Windows 10 1909.
Author of Total Commander
http://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 10330
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Re: [TC 10 b4] problems when changing attributes for certain filename on FAT32 drives

Post by *petermad »

I have used copy and paste (Ctrl+V works in cmd.exe) and I could paste del’ivoire.txt just fine.
Hmm, here I can only right click and choose "Paste", I cannot use Ctrl+V in cmd.exe.

But I agree that also here the attribute is set for the wrong file - as it also is in Windows Explorer - so it is a Windows problæem, not a TC problem - you can move this topic to "TC Behaviour which will not be changed"
License #524 (1994)
Danish Total Commander Translator
TC 9.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (20H2) 64bit, 'Everything' 1.4.1.1005 x64
TC 3.21b2 on Android 6 & 11
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Dalai
Power Member
Power Member
Posts: 7554
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: [TC 10 b4] problems when changing attributes for certain filename on FAT32 drives

Post by *Dalai »

petermad wrote: 2021-04-09, 18:09 UTC
I have used copy and paste (Ctrl+V works in cmd.exe) and I could paste del’ivoire.txt just fine.
Hmm, here I can only right click and choose "Paste", I cannot use Ctrl+V in cmd.exe.
FYI: CMD supports Ctrl+V - and some other hotkeys and features - only on Windows 10 when the new CMD features are enabled (which they are by default), but not on older Windows versions.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups
User avatar
petermad
Power Member
Power Member
Posts: 10330
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Re: Cannot be solved [TC 10 b4] problems when changing attributes for certain filename on FAT32 drives

Post by *petermad »

only on Windows 10 when the new CMD features are enabled (which they are by default)
Well, found the setting, and it wasn't enabled in my Windows 10 - perhaps because my Windows 10 is updated from Windows 8, so the original setting was probably kept.
License #524 (1994)
Danish Total Commander Translator
TC 9.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (20H2) 64bit, 'Everything' 1.4.1.1005 x64
TC 3.21b2 on Android 6 & 11
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
DrShark
Power Member
Power Member
Posts: 1741
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262

Re: Cannot be solved [TC 10 b4] problems when changing attributes for certain filename on FAT32 drives

Post by *DrShark »

Changing attributes, opening (with Enter or Shift+Enter), passing to F4 editor (at least if Windows Notepad is used) work with correct both files if their short names are passed by TC (e.g. after executing cm_switchlongnames 2). Since we already have another case where shortnames help:
https://ghisler.ch/board/viewtopic.php?f=28&t=53893&p=362986
which is not moved to Behavior will not be changed subforum, there is a hope in future TC will use short names for such problem names by default when executing or passing to external applications.
Android 4.3.1 no root, kernel 08.09.2016; Win7 Home Premium SP1 rus 32 bit
TC #149847 Personal licence

Cuz we're all in this together, We're here to make it right
User avatar
petermad
Power Member
Power Member
Posts: 10330
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Re: Cannot be solved [TC 10 b4] problems when changing attributes for certain filename on FAT32 drives

Post by *petermad »

2DrShark
...work with correct both files if their short names are passed by TC...
That could be a solution, since the problem only exists on FAT drives and AFAIK 8dot3names are always enabled on FAT drives unlike NTFS drives.

I just noticed one problem after executing cm_switchlongnames 2: If you copy the file to another drive (FAT or NTFS) then it is only the short filenames that are copied, the files on the other drive are still shown with the short names after executing cm_switchlongnames 1

passing to F4 editor (at least if Windows Notepad is used) work with correct both files if their short names are passed by TC
Just checked - yes, it works with notepad.exe - BUT I tried with two other text editors (notepad++ and metapad) configured for F4, and with those it is always the same file that is opened by the editor: del'iv~1.txt = del'ivoire.txt - also if I press F4 on del'iv~2.txt = del’ivoire.txt
License #524 (1994)
Danish Total Commander Translator
TC 9.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (20H2) 64bit, 'Everything' 1.4.1.1005 x64
TC 3.21b2 on Android 6 & 11
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
DrShark
Power Member
Power Member
Posts: 1741
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262

Re: Cannot be solved [TC 10 b4] problems when changing attributes for certain filename on FAT32 drives

Post by *DrShark »

The problem also affects TC's Copy/Pack/Move/Delete functions, so the action can be applied to the wrong file or, if used on both files, action happens actually for 1 file, e.g. TC deletes only 1 file, and copies/packs the content of 1 file.

Could TC at least detect such situations and warn that in such a case an action is going to happen on a wrong file (with suggestion for user to restart the operation in short names mode to make it work on correct files)?
petermad wrote: 2021-04-10, 11:10 UTC I just noticed one problem after executing cm_switchlongnames 2: If you copy the file to another drive (FAT or NTFS) then it is only the short filenames that are copied, the files on the other drive are still shown with the short names after executing cm_switchlongnames 1
On my USB stick with FAT-32 after actions like Copy/Move/Rename even within the same drive while TC is in "cm_switchlongnames 2" mode the file gets the capitalized short name as a longname (so original long name is lost). AFAIK it has always been like that in TC's short names mode.
Android 4.3.1 no root, kernel 08.09.2016; Win7 Home Premium SP1 rus 32 bit
TC #149847 Personal licence

Cuz we're all in this together, We're here to make it right
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 40779
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Cannot be solved [TC 10 b4] problems when changing attributes for certain filename on FAT32 drives

Post by *ghisler(Author) »

Could TC at least detect such situations and warn that in such a case an action is going to happen on a wrong file
How? Who knows what other characters are affected...
Author of Total Commander
http://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1741
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262

Re: Cannot be solved [TC 10 b4] problems when changing attributes for certain filename on FAT32 drives

Post by *DrShark »

ghisler(Author) wrote: 2021-04-14, 16:06 UTC
Could TC at least detect such situations and warn that in such a case an action is going to happen on a wrong file
How? Who knows what other characters are affected...
We don't know, but it can work similar to the blocklist (for $MFT etc.) to which you are adding new known problem names internally.

I guess that the feature to work with problem characters in names can even be based on that blocklist feature: you could detect the names with problem characters like that apostrophe or a semicolon (from this topic) and replace long file names with such characters to short names internally for most of TC's functions (probably except some listing places like file window or Find Files search result).
Android 4.3.1 no root, kernel 08.09.2016; Win7 Home Premium SP1 rus 32 bit
TC #149847 Personal licence

Cuz we're all in this together, We're here to make it right
Post Reply