MRT & Files or Directories (That Already Exist)

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

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

MRT & Files or Directories (That Already Exist)

Post by *Balderstrom »

Given the following List:
_TEMP 00\
_TEMP 00\
_TEMP 01\
_TEMP 02\
_TEMP 03\
TEMP 01\
TEMP 02\
If you select all six files, (be it files/or folders) Then TC will rename the ones it can, and skip the ones it can't.

BUG:
If instead, you only select the first four, and attempt to strip out the leading underscore with Search For: ^_
Then TC refuses to rename anything, with the popup:
---------------------------
Total Commander
---------------------------
Error, a file with this name already exists in the directory!

TEMP 01
---------------------------
OK
---------------------------
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Actually it is not a bug.

TC renames objects from first to last. If it finds in some step that object with target name already exists (in your case it is obviously) it stops operation and shows such message.

You need to append some unique prefix to all objects to be renamed and to remove it while renaming if you want to exchange names between theese objects (i.e. if you need to use result names of some objects for another objects).

E.g. in your case first step is to rename with name $$$[N], then you may use button at the left of 'Start!' to load renamed names again into renamer, then you may remove our '$$$' and your '_'- just rename with name [N4-] and your '^_' with '' replacement.
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

It could be the last item in the list, MVV.
And it will not do any of the renames.

It is a bug. If I select all of the files, then the MRT will rename what it can and skip what it can't.
Yet, If I don't select the files that aren't going to be renamed anyways then none of them get renamed -- due to there being one exception that could be anywhere in the list, first, middle or last.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Sorry I didn't understand it correctly.
You're right, if object with target name exists in working folder, TC shows error and does nothing.
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

In fact we have 4 separate behaviours -

Behaviour 1: Temp1 Exists on the Right.
Drag Temp1 from Left to Right, or F6 Move
---> Folders Merge with no option given.

Behaviour 2: Folders Temp and Temp1 exist in same panel.
In-line-rename Temp1 to Temp, Option to MOVE Temp1 INTO Temp or do nothing.

Behaviour 3: MRT rename when both Temp and Temp1 are selected.
When Temp1 would be renamed to Temp -- do not rename.

Behaviour 4: MRT rename when both Temp and Temp1 exist, but only Temp1 is selected -- no Renames occur.


In fact The drag and drop / F6 Option (to Merge) should be presented in all cases.

Given a folder that contains:
Temp\
Temp1\
Temp2\
Temp3\
etc.
If MRT provided the option to Merge like Drag&Drop and F6 do, you could Select folders Temp1 thru TempX choose to rename them to "Temp" and merge all the folders in one fell-efficient swoop. With one single pop-up "Merge Renamed Folders into Temp?" [Yes] [No] [All]

Of the lot, behaviour 2 and 4 are the worst. If you really wanted to move "Temp1" into Temp via in-line-rename, you would think you'd have to rename Temp1 to "Temp\Temp1" -- otherwise they should merge --- or at least be given the Option to Move INTO, Merge or Skip :-)
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Behaviour 2 is standard from DOS times. Just open CMD and try to use command move folder1 folder2 when folder2 exists. You just need to understand that rename command is move command. It is Windows Explorer who have messed it. It seems that it was discussed already...

And, MRT is just renamer, not mover or joiner. Yes, it may be used to move from another folder but it wasn't programmed for such task. But I agree that MRT should allow to rename other objects.
User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post by *JohnFredC »

A consistent behavior is always to be desired.
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50517
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Actually it's not a bug: When you select all and set the rename rules so there are no duplicates in the end, TC will rename all. It will temporarily rename files/dirs if their name is later used by another file. If you just select the 4 first, there is no chance that TC can rename the last two, so their names cannot be re-used.
Author of Total Commander
https://www.ghisler.com
Post Reply