TCrc4 - Multi-Rename bug

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
cheming
Member
Member
Posts: 153
Joined: 2004-05-07, 14:38 UTC
Location: China

TCrc4 - Multi-Rename bug

Post by *cheming »

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)
User avatar
karlchen
Power Member
Power Member
Posts: 4601
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Issue confirmed.

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--
Result:
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. :wink:

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
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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
User avatar
karlchen
Power Member
Power Member
Posts: 4601
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

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:
file comments are lost, and some file comments are assigned to the incorrect filenames.
I.E. MRT does not take file comments into consideration.
To repeat it, some of those comments that are kept are assigned to the wrong filenames.

The resulting list in my example should look like this (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-- disk3
disk5.lst 326 08.04.2005 23:53 -a-- disk4
disk6.lst 228 08.04.2005 23:56 -a-- disk5
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-- 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)
Karl
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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
User avatar
karlchen
Power Member
Power Member
Posts: 4601
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Thanks, Christian, for clearing this up.

I had had the impression you might have missed the second part of the issue: some of the remaining comments being assigned to the wrong filenames.

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

Post by *ghisler(Author) »

Should be fixed in RC5, please test!
Author of Total Commander
https://www.ghisler.com
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Post by *Flint »

Yes, confirm fixed in TC7rc5.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks!
Author of Total Commander
https://www.ghisler.com
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

Confirm fixed in RC5 - even works with the Undo function of MRT.
Rock solid operation as usual in TC - cool. 8)
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
Post Reply