Certain setting combinations in Misc. are ignored

Please report only one bug per message!

Moderators: sheep, Hacker, Stefan2, white

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

Certain setting combinations in Misc. are ignored

Post by *petermad » 2019-03-09, 22:40 UTC

If I in "Configuration" -> Options..." -> "Misc." -> "Get confirmation before" disable EITHER "Overwriting/Deleting read-only files" OR I disable "Overwriting/Deleting hidden/system files" but NOT BOTH, then I still get warnings for both read-only and hidden/system when copying or moving a directory containing all 3 types of such files.

Only if I disable BOTH options, the warnings are suppressed. So if I for example want to only get warnings when copying/moving hidden/system files but not for read-only files, then that is not possible.

This is not a new bug for TC 9.22 - it has been there at least since v. 8.52a
License #524
Danish Total Commander Translator
TC 9.21a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit and TC 2.92b1 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 36997
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Certain setting combinations in Misc. are ignored

Post by *ghisler(Author) » 2019-03-10, 09:08 UTC

Could you give me more details, please? I have tested this but cannot find any problems:

Setup: directory "test" with 3 files:
file1.txt [read-only]
file2.txt [system]
file3.txt [read-only+system]

Scenario 1: Warn for read-only, but not hidden/system:
a) copy the "test" directory to empty folder -> no warnings
b) copy the "test" directory again -> I get the following warnings:
- normal "overwrite" warning, unless "overwrite files" is unchecked in Configuration - Options - Misc
- "overwrite hidden/system" warning for files file2.txt and file3.txt
- no warning for read only file file1.txt

Scenario 2: Do not warn for read-only, but warn for hidden/system:
a) copy the "test" directory to empty folder -> no warnings
b) copy the "test" directory again -> I get the following warnings:
- normal "overwrite" warning, unless "overwrite files" is unchecked in Configuration - Options - Misc
- "overwrite read-only" warning for files file1.txt and file2.txt
- no warning for hidden file file3.txt

I have tested the standard copy method (using CopyFileEx) and the old "default copy method".
Please note that these options have no influence on the Explorer copy method.
Author of Total Commander
http://www.ghisler.com

User avatar
Usher
Senior Member
Senior Member
Posts: 271
Joined: 2011-03-11, 10:11 UTC

Re: Certain setting combinations in Misc. are ignored

Post by *Usher » 2019-03-10, 13:05 UTC

2petermad
What file systems are on source and target partitions - both NTFS or maybe some FAT?
Regards from Poland
Andrzej P. Wozniak

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

Re: Certain setting combinations in Misc. are ignored

Post by *petermad » 2019-03-10, 13:15 UTC

Setup: directory "test" with 3 files:
file0.txt [no attribute or just archive]
file1.txt [read-only]
file2.txt [system]
file3.txt [hidden]

Here below green is expected behavior and red is unexpected behavior.

In all scenarios with OverwriteFiles=1 and CopyDefaultMethod=0

Scenario 1: Warn for read-only, but not hidden/system:
a) copy the "test" directory to empty folder
b) copy the "test" directory again :
When TC's overwrite dialog pops up choose: "Overwrite all"
TC asks to overwrite file1.txt because it is READ ONLY" - click "Overwrite
TC asks to overwrite file2.txt because it is HIDDEN OR SYSTEM - click "Overwrite"
TC asks to overwrite file3.txt because it is HIDDEN OR SYSTEM - click "Overwrite"

Scenario 2: Warn for hidden/system, but not read-only:
a) copy the "test" directory to empty folder
b) copy the "test" directory again :
When TC's overwrite dialog pops up choose: "Overwrite all"
TC asks to overwrite file1.txt because it is READ ONLY - click "Overwrite"
TC asks to overwrite file2.txt because it is HIDDEN OR SYSTEM - click "Overwrite"
TC asks to overwrite file3.txt because it is HIDDEN OR SYSTEM - click "Overwrite"

Scenario 3: Warn for read-only, but not hidden/system:
a) move the "test" directory to empty folder on another drive:
TC asks to delete the original file1.txt because it is READ ONLY - click "Delete"
TC asks to delete the original file2.txt because it is HIDDEN or SYSTEM - click "Delete"
TC asks to delete the original file3.txt because it is HIDDEN or SYSTEM - click "Delete"

Scenario 4: Warn for hidden/system, but not read-only:
a) move the "test" directory to empty folder on another drive:
TC asks to delete the original file1.txt because it is READ ONLY - click "Delete"
TC asks to delete the original file2.txt because it is HIDDEN or SYSTEM - click "Delete"
TC asks to delete the original file3.txt because it is HIDDEN or SYSTEM - click "Delete"


The above is with my current wincmd.ini

-----------------------------------------

If I do the same with a fresh wincmd.ini where I have set ShowHiddenSystem=1 then Scenario 3 and 4 is the same, but scenario 1 and 2 to behaves like this:

Scenario 1: Warn for read-only, but not hidden/system:
a) copy the "test" directory to empty folder
b) copy the "test" directory again :
When TC's overwrite dialog pops up choose: "Overwrite all"
TC asks to overwrite file1.txt because it is READ ONLY - click "Overwrite"

Scenario 2: Warn for hidden/system, but not read-only:
a) copy the "test" directory to empty folder
b) copy the "test" directory again :
When TC's overwrite dialog pops up choose: "Overwrite all"
TC asks to overwrite file1.txt because it is READ ONLY - click "Overwrite"

So TC doesn't ask to overwrite hidden/system files in scenario 2 as expected but asks to overwrite read-only file as not expected

If I set CopyDefaultMethod=0 I get a confirmation dialog for overwriting system/hidden files when it is requested in Misc. (like the first described scenario 1 and 2), but I don't get the expected dialog for overwriting system/hidden files when CopyDefaultMethod=1

If I set ShowCopyOptions=1 I get a confirmation dialog for overwriting read-only files even when it is not requested in Misc.

If I set ShowCopyOptions=0 I get a confirmation dialog for overwriting system/hidden and read-only files even when it is not requested in Misc. (and CopyDefaultMethod=0)

So CopyDefaultMethod=1 prevents an overwriting confirmation dialog for system/hidden
And ShowCopyOptions=1 always results in overwriting confirmation dialog for read-only files and system/hidden files (except when confirmation for system/hidden files is prevented by CopyDefaultMethod=1
)

When confirmation for both read-only and system/hidden files is disabled, everything seems to work as expected (no warnings) no matter how CopyDefaultMethod and ShowCopyOptions are set.

So it is a matter of testing all possible combinations of CopyDefaultMethod, ShowCopyOptions and OverwriteReadonly / OverwriteHidSys
Last edited by petermad on 2019-03-10, 22:42 UTC, edited 4 times in total.
License #524
Danish Total Commander Translator
TC 9.21a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit and TC 2.92b1 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

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

Re: Certain setting combinations in Misc. are ignored

Post by *petermad » 2019-03-10, 13:21 UTC

2Usher
What file systems are on source and target partitions - both NTFS or maybe some FAT?
I have tested both with FAT/FAT, NTFS/NTFS, NTFS/FAT and FAT/NTFS - no difference.

It is the setting of CopyDefaultMethod and ShowCopyOptions that makes the difference
License #524
Danish Total Commander Translator
TC 9.21a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit and TC 2.92b1 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

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

Re: Certain setting combinations in Misc. are ignored

Post by *petermad » 2019-03-10, 13:34 UTC

Another finding during testing this.

After confirming overwriting HIDDEN or SYSTEM files, the cursor in the source window is moved one item down for each new overwrite warning dialog where I press the "Overwrite" button. This does not happen if I press the "All" button when asked to overwrite HIDDEN or SYSTEM files.
License #524
Danish Total Commander Translator
TC 9.21a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit and TC 2.92b1 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 36997
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Certain setting combinations in Misc. are ignored

Post by *ghisler(Author) » 2019-03-11, 11:20 UTC

Oh, I see - it happens only when you open the extra options in the F5 copy dialog! It has the following checkbox:
[ ] Overwrite/Delete read only/hidden/system

If this is unchecked, TC will ask about overwriting hidden/system and read only files. If it is checked, it will not ask about any of them.
This conflicts with the choice you make in Configuration - Options - Misc: If only one of the two is checked there, it is ignored in the extended overwrite dialog. If both are unchecked, TC just checks the option "Overwrite/Delete read only/hidden/system", and when you uncheck it, TC asks about both options.

The problem with CopyDefaultMethod=1 is that CopyFileEx doesn't return an error when trying to overwrite hidden/system files, only read only files. Therefore you only get the warning for files which also have the read only attribute. I have added an extra check for that now.

I have just sent you a link to a private beta version, please test it as soon as possible!
the cursor in the source window is moved one item down for each new overwrite warning dialog
I cannot reproduce that. But since it's unrelated and only cosmetic, I will postpone it until after the release of TC 9.22.
Author of Total Commander
http://www.ghisler.com

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

Re: Certain setting combinations in Misc. are ignored

Post by *petermad » 2019-03-11, 18:24 UTC

2ghisler(Author)

I think I have now tested the private beta for all possible combinations of CopyDefaultMethod, ShowCopyOptions and OverwriteReadonly / OverwriteHidSys - and the bug seem to be partly gone - see below
the cursor in the source window is moved one item down for each new overwrite warning dialog

I cannot reproduce that. But since it's unrelated and only cosmetic, I will postpone it until after the release of TC 9.22.
It is not just cosmetic - If I copy a direcetory to somewhere else, and I during that copy process get warnings about overwriting system/hidden files, which I approve, and I thereafter press delete to delete the source directory - I end up deleting the wrong directory, if I don't notice that the cursor has moved to another directory than the one I started out copying.

To reproduce it try this unpack this archive: http://madsenworld.dk/tcmd/overwritewarning.zip
Then do this:
Enable warning for overwriting hidden/system, but not read-only files:
a) copy the "test" directory to empty folder
b) copy the "test" directory again :
When TC's overwrite dialog pops up choose: "Overwrite all"
TC asks to overwrite file2.txt because it is HIDDEN OR SYSTEM - click "Overwrite"
TC asks to overwrite file3.txt because it is HIDDEN OR SYSTEM - click "Overwrite"

Now the cursor is placed on the "test4" dir.

Also try and reverse the sort order (name sorting), so that "test" is the last dir and do the test again:
Now TC only warns about overwriting fil2.txt, but not fil3.txt - unless you set CopyDefaultMethod=1, and the cursor jumps to the"test2" dir

With normal name sorting then try again with the "test2" dir - here there is only one system/hidden file - and when doing the test the cursor stays on "test2". Reverse the sort order and do the test with "test2" dir - no warning about overwriting at all, unless CopyDefaultMethod=1

It seems that the fix for CopyDefaultMethod=0 doesn't always work depending of the sequence of the files processed - read-only, system, hidden works, but not for example hidden, system, read-only or system, read-only ("test2" dir reverse sorted)
License #524
Danish Total Commander Translator
TC 9.21a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit and TC 2.92b1 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 36997
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Certain setting combinations in Misc. are ignored

Post by *ghisler(Author) » 2019-03-12, 10:12 UTC

See my reply via e-mail.
Author of Total Commander
http://www.ghisler.com

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 36997
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Certain setting combinations in Misc. are ignored

Post by *ghisler(Author) » 2019-03-14, 15:33 UTC

This should be fixed now in Total Commander 9.22!

It's possible that this fix has some negative side effects, like too many confirmation dialogs. Therefore it can be disabled via wincmd.ini:
[Confirmation]
OverwriteHidSysNotReadonly=1

This will revert to the old behaviour of TC 9.21a regarding the overwriting of hidden/system files: When using the new default copy method, you will not be asked to overwrite hidden/system files unless they also have the read only flag set. In TC 9.22, you will get the overwrite confirmation also when read only isn't set, and you have activated overwrite/delete confirmation for hidden/system files in Configuration - Options - Misc.

Please let me know as soon as possible if there are any problems with the fix, so I can fix them in TC 9.22a.
Author of Total Commander
http://www.ghisler.com

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

Re: Certain setting combinations in Misc. are ignored

Post by *petermad » 2019-03-14, 23:02 UTC

I can confirm that I now get overwrite warnings for hidden/system files when expected with both the standard copy method and the default method/big file copy mode and with any setting of ShowCopyOptions. :-)

I can also confirm that with standard copy metod (CopyDefaultMethod=1) and OverwriteHidSysNotReadonly=1 I dont get warnings for overwriting hidden/system files unless they are also marked as read-only.

But, the text in the Help file has to be canged though, from:
OverwriteHidSysNotReadonly=1 Ask before overwriting/deleting hidden/system files without read-only attribute (standard copy method only)
to:
OverwriteHidSysNotReadonly=0 Ask before overwriting/deleting hidden/system files without read-only attribute (standard copy method only)
to be correct, and also because 0 is now the default setting.

_______________________

Alternatively the text could be:
OverwriteHidSysNotReadonly=1 Ask before overwriting/deleting hidden/system only when read-only attribute is also set (standard copy method only)
but since the help file usually shows the default value for a parameter, I don't think this is the best description
License #524
Danish Total Commander Translator
TC 9.21a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit and TC 2.92b1 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 36997
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Certain setting combinations in Misc. are ignored

Post by *ghisler(Author) » 2019-03-15, 14:39 UTC

I'm aware that the defaults are wrong in the help, but not only for OverwriteHidSysNotReadonly, but for all values in that section. I didn't want to change that so shortly before the final release.
Author of Total Commander
http://www.ghisler.com

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

Re: Certain setting combinations in Misc. are ignored

Post by *petermad » 2019-03-15, 16:37 UTC

but for all values in that section
Hmm, if I start TC with a clean ini file, the Confirmation section looks like this

Code: Select all

[Confirmation]
deleteDirs=1
OverwriteFiles=1
OverwriteReadonly=1
OverwriteHidSys=1
MouseActions=1
Wich corresponds fine with the Help file:
[Confirmation] Confirmations
deleteDirs=1 Ask before non-empty directories
MouseActions=1 Ask when dropping files
OverwriteFiles=1 Ask before overwriting files
OverwriteHidSys=1 Ask before overwriting/deleting hidden/system files
OverwriteReadonly=1 Ask before overwriting/deleting read-only files
So nothing to change here...?
Last edited by petermad on 2019-03-17, 15:12 UTC, edited 1 time in total.
License #524
Danish Total Commander Translator
TC 9.21a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit and TC 2.92b1 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 36997
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Certain setting combinations in Misc. are ignored

Post by *ghisler(Author) » 2019-03-17, 10:35 UTC

Ok, I thought it was reversed due to the name starting with "Overwrite". That's unfortunate. I will change the docs for OverwriteHidSysNotReadonly.
Author of Total Commander
http://www.ghisler.com

Post Reply