Bug found in auto-rename

Moderators: Hacker, petermad, Stefan2, white

Nazaren0
Junior Member
Junior Member
Posts: 2
Joined: 2025-03-26, 13:19 UTC

Bug found in auto-rename

Post by *Nazaren0 »

Hello,

there seems to be a bug with the auto-renaming system. I've tried to find a setting in the configuration options, but it seems it's not possible to customize this behavior.

Example:

Original name: "Sales Report (2016) - First Rev.txt"
Auto-renamed as: "Sales Report (2017) - First Rev.txt" :?
Should be auto-renamed as "Sales Report (2016) - First Rev (2).txt" :!:

Regards
sa16
Senior Member
Senior Member
Posts: 324
Joined: 2021-09-10, 07:15 UTC

Re: Bug found in auto-rename

Post by *sa16 »

I confirm (when copying).
In MRT, the file is renamed correctly.
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Bug found in auto-rename

Post by *petermad »

Confirmed too.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Bug found in auto-rename

Post by *ghisler(Author) »

This isn't a bug, it's how the function works - it looks for a number in braces and increases it by one.
In MRT, the file is renamed correctly.
What do you mean? Isn't the report is about mrt?
Author of Total Commander
https://www.ghisler.com
sa16
Senior Member
Senior Member
Posts: 324
Joined: 2021-09-10, 07:15 UTC

Re: Bug found in auto-rename

Post by *sa16 »

What do you mean? Isn't the report is about mrt?
It seemed to me that the report on the commands cm_Copy or cm_Rename, if the "Auto-rename copied", "Auto-rename target files" overwrite option was selected.
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Bug found in auto-rename

Post by *petermad »

if the "Auto-rename copied", "Auto-rename target files" overwrite option was selected.
That is my impression too. And my confirmation of the problem regards copying with these options selected
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Nazaren0
Junior Member
Junior Member
Posts: 2
Joined: 2025-03-26, 13:19 UTC

Re: Bug found in auto-rename

Post by *Nazaren0 »

ghisler(Author) wrote: 2025-03-27, 15:01 UTC This isn't a bug, it's how the function works - it looks for a number in braces and increases it by one.
Any option or review to include a setting in the auto-rename feature like "force rename only at end of filename" ?
User avatar
Galizza
Member
Member
Posts: 198
Joined: 2018-09-07, 05:21 UTC

Re: Bug found in auto-rename

Post by *Galizza »

Nazaren0 wrote: 2025-03-26, 14:06 UTC Original name: "Sales Report (2016) - First Rev.txt"
Auto-renamed as: "Sales Report (2017) - First Rev.txt"
If you read the names of the Original & Auto-renamed files, in my opinion it is a bug and a quite dangerous one.

The original file must be auto-renamed as "Sales Report (2016) - First Rev (2).txt"
User avatar
white
Power Member
Power Member
Posts: 5744
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Bug found in auto-rename

Post by *white »

Galizza wrote: 2025-03-28, 13:27 UTC If you read the names of the Original & Auto-renamed files, in my opinion it is a bug and a quite dangerous one.
I think that the auto-rename options in the overwrite dialog was designed to be flexible when it was added 20 years ago to TC 7. The last number between brackets anywhere in the filename is increased (even when the number is in the filename extension).
sa16
Senior Member
Senior Member
Posts: 324
Joined: 2021-09-10, 07:15 UTC

Re: Bug found in auto-rename

Post by *sa16 »

Users expect auto-renaming to follow the rules in Help:
Auto-rename copied
When a name collision occurs, the copied/moved files will be renamed automatically in the form filename(1).ext, filename(2).ext etc.
Auto-rename target files
When a name collision occurs, the existing target files will be renamed automatically before copying/moving the source files, in the form filename(1).ext, filename(2).ext etc.
and according to the parameter:
AutoRenameMode=3 Determines how files are auto-renamed when copying or in multi-rename tool. Sum of:
1: append number (x) separated by space, e.g. name (2).txt instead of name(2).txt
2: start number at (2), not (1), e.g. name.txt, name (2).txt etc.
Fla$her
Power Member
Power Member
Posts: 2981
Joined: 2020-01-18, 04:03 UTC

Re: Bug found in auto-rename

Post by *Fla$her »

There is no doubt that parentheses with a number should be searched at the end of the base name and nowhere else.
Overquoting is evil! 👎
User avatar
white
Power Member
Power Member
Posts: 5744
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Bug found in auto-rename

Post by *white »

How about numbers with leading zeros? Currently it works like this:

Existing name:
name (001).txt

Auto renamed:
name (2).txt
User avatar
Galizza
Member
Member
Posts: 198
Joined: 2018-09-07, 05:21 UTC

Re: Bug found in auto-rename

Post by *Galizza »

white wrote: 2025-03-29, 11:54 UTC How about numbers with leading zeros? Currently it works like this:

Existing name:
name (001).txt

Auto renamed:
name (2).txt
This option is far from ideal, but if we want prioritize security to the maximum.

Existing name:
name (001).txt

Should be auto renamed:
name (001)(2).txt

This would basically be following what is indicated in Help to the letter.
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Bug found in auto-rename

Post by *petermad »

Fla$her wrote: 2025-03-29, 07:25 UTC There is no doubt that parentheses with a number should be searched at the end of the base name and nowhere else.
I agree.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
AntonyD
Power Member
Power Member
Posts: 1554
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: Bug found in auto-rename

Post by *AntonyD »

Should be auto renamed:
name (001)(2).txt
I also fully agree on that.
#146217 personal license
Post Reply