TCrc4 - Multi-Rename bug
Moderators: Hacker, petermad, Stefan2, white
TCrc4 - Multi-Rename bug
suppose we have three files: 1 2 3 and with the comments 1 2 3
then, use MR to change the filename to : 2 3 4
then, look at the comments you would see the result is : 1 3 (lost)
then, use MR to change the filename to : 2 3 4
then, look at the comments you would see the result is : 1 3 (lost)
Issue confirmed.
How to reproduce:
Files are renamed correctly. Yet, file comments are lost, and some file comments are assigned to the incorrect filenames.
I.E. MRT does not take file comments into consideration.
Summary:
I am not sure if we are facing a real bug here, or merely a limitation of the rename procedure used by T.C in order to add 1 to each counter in each filename.
If in such a case TC started by renaming the last file in the list, disk5.lst, first and then went downwards through the list, no temporary filenames would be needed and hence no comments would be lost.
The above list would look like this:
disk3.lst 345 08.04.2005 23:46 -a-- disk2
disk4.lst 357 08.04.2005 23:49 -a-- disk3
disk5.lst 326 08.04.2005 23:53 -a-- disk4
disk6.lst 228 08.04.2005 23:56 -a-- disk5
So if a counter is used and the counter increases, the MRT should start by renaming the last file first (the one with the highest counter).
If a counter is used and the counter decreases, the MRT should start by renaming the first file first (the one with the lowest counter).
I cannot make any judgement, if this can be implemented easily or at all. I cannot make any judgement, if this may have any unwanted side effects.
I simply did not care to analyze any imaginable MRT scenarios.
The issue was not introduced by TC7, but exists in TC6.56 e.g., too. Realized this when I used TC6.56 to revert the filenames back to their original states.
A closer look at the MRT and its renaming resultlist suggests that the MRT always proceeds from the first filename to the last filename in any given list and renames the files top down, no matter which renaming rule has been specified.
Final verdict:
So very likely it all amounts to the fact that the MRT does not take file comments into consideration. (Lacking feature)
Karl
How to reproduce:
- Original file list (comment is in the last column):
disk2.lst 345 08.04.2005 23:46 -a-- disk2
disk3.lst 357 08.04.2005 23:49 -a-- disk3
disk4.lst 326 08.04.2005 23:53 -a-- disk4
disk5.lst 228 08.04.2005 23:56 -a-- disk5 - Call MRT and rename using:
Filename: [N1-4][C]
Extension: [E]
Define counter: Start with: 3, Step: 1, Digits: 1 - Press "Start"
- See the "Result list"
"C:\temp\disk3.lst" -> "disk4.0"
"C:\temp\disk2.lst" -> "disk3.lst"
"C:\temp\disk4.lst" -> "disk5.1"
"C:\temp\disk4.0" -> "disk4.lst"
"C:\temp\disk5.lst" -> "disk6.lst"
"C:\temp\disk5.1" -> "disk5.lst"
Notice the temporary filenames used.
They give a hint why some comments are lost: The descript.ion file simply does not hold any lines for the temporary filenames. (How should it?) - Resulting file list (comment is in the last column):
disk3.lst 345 08.04.2005 23:46 -a-- disk2
disk4.lst 357 08.04.2005 23:49 -a-- disk4
disk5.lst 326 08.04.2005 23:53 -a-- disk5
disk6.lst 228 08.04.2005 23:56 -a--
Files are renamed correctly. Yet, file comments are lost, and some file comments are assigned to the incorrect filenames.
I.E. MRT does not take file comments into consideration.
Summary:
I am not sure if we are facing a real bug here, or merely a limitation of the rename procedure used by T.C in order to add 1 to each counter in each filename.
If in such a case TC started by renaming the last file in the list, disk5.lst, first and then went downwards through the list, no temporary filenames would be needed and hence no comments would be lost.
The above list would look like this:
disk3.lst 345 08.04.2005 23:46 -a-- disk2
disk4.lst 357 08.04.2005 23:49 -a-- disk3
disk5.lst 326 08.04.2005 23:53 -a-- disk4
disk6.lst 228 08.04.2005 23:56 -a-- disk5
So if a counter is used and the counter increases, the MRT should start by renaming the last file first (the one with the highest counter).
If a counter is used and the counter decreases, the MRT should start by renaming the first file first (the one with the lowest counter).
I cannot make any judgement, if this can be implemented easily or at all. I cannot make any judgement, if this may have any unwanted side effects.
I simply did not care to analyze any imaginable MRT scenarios.

The issue was not introduced by TC7, but exists in TC6.56 e.g., too. Realized this when I used TC6.56 to revert the filenames back to their original states.
A closer look at the MRT and its renaming resultlist suggests that the MRT always proceeds from the first filename to the last filename in any given list and renames the files top down, no matter which renaming rule has been specified.
Final verdict:
So very likely it all amounts to the fact that the MRT does not take file comments into consideration. (Lacking feature)
Karl
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Indeed this is a limitation of the rename tool. The problem is that it has to do additional renames because of the name colisions. If you rename 1 2 3 in 2 3 4, already the first rename call 1->2 will fail because 2 already exists. Even the second try 2->3 fails for the same reason. TC then renames 2 to 3.0, then 1 to 2, then 3 to 4, and finally 3.0 to 3. Comments are lost in this case. I will try to keep them even in this special case.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Good evening, Christian.
If you take the time to read through my lengthy step by step reproduction of the issue, you will see that as I wrote:
The resulting list in my example should look like this (comment is in the last column):
If you take the time to read through my lengthy step by step reproduction of the issue, you will see that as I wrote:
To repeat it, some of those comments that are kept are assigned to the wrong filenames.file comments are lost, and some file comments are assigned to the incorrect filenames.
I.E. MRT does not take file comments into consideration.
The resulting list in my example should look like this (comment is in the last column):
But in fact it looks like this:disk3.lst 345 08.04.2005 23:46 -a-- disk2
disk4.lst 357 08.04.2005 23:49 -a-- disk3
disk5.lst 326 08.04.2005 23:53 -a-- disk4
disk6.lst 228 08.04.2005 23:56 -a-- disk5
Karldisk3.lst 345 08.04.2005 23:46 -a-- disk2
disk4.lst 357 08.04.2005 23:49 -a-- disk4 (wrong, comment "disk3" lost)
disk5.lst 326 08.04.2005 23:53 -a-- disk5 (wrong)
disk6.lst 228 08.04.2005 23:56 -a-- (wrong)
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Yes, that's what I answered too! The names are moved correctly for the simple rename operations, but not for the complex ones (with interim names). I have already added it now for RC5.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Yes, confirm fixed in TC7rc5.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
Using TC 11.03 / Win10 x64
Using TC 11.03 / Win10 x64
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact: