TC8.0B6 - MRT Bug

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

TC8.0B6 - MRT Bug

Post by *Balderstrom »

Given the following folder structure:
C:\_TEMP\FOO1\FOO1 - Copy (2)\FOO1 - Copy (3)\FOO1 - Copy (4)\FOO1 - Copy (5)\FOO1 - Copy (6)\

Browse into the folders, until the cursor is on "FOO1 - Copy (6)"; launch MRT
:MRT:
Rename Mask: [=tc.path][N]
Ext: [E]
Search: FOO1
Replace: Folder
TC claims that the New Name will be:
C:\_TEMP\Folder\Folder - Copy (2)\Folder - Copy (3)\Folder - Copy (4)\Folder - Copy (5)\Folder - Copy (6)\

The Actual result:
C:\_TEMP\FOO1\FOO1 - Copy (2)\FOO1 - Copy (3)\FOO1 - Copy (4)\FOO1 - Copy (5)\C\_TEMP\Folder\Folder - Copy (2)\Folder - Copy (3)\Folder - Copy (4)\Folder - Copy (5)\Folder - Copy (6)\
User avatar
HolgerK
Power Member
Power Member
Posts: 5409
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Re: TC8.0B6 - MRT Bug

Post by *HolgerK »

Not confirmed with:
:MRT:
Rename Mask: [=tc.path][N]
Ext: [E]
Search: FOO1
Replace: Folder
T:\_TEMP\Folder\Folder - Copy (2)\Folder - Copy (3)\Folder - Copy (4)\Folder - Copy (5)\Folder - Copy (6)
results into :
---------------------------
Total Commander
---------------------------
Error, could not rename the files shown in bold!
---------------------------
OK
---------------------------
But confirmed with:
:MRT:
Rename Mask: [=tc.path:3-][N]
Ext: [E]
Search: FOO1
Replace: Folder
\_TEMP\Folder\Folder - Copy (2)\Folder - Copy (3)\Folder - Copy (4)\Folder - Copy (5)\Folder - Copy (6)
Result is:
T:\_TEMP\FOO1\FOO1 - Copy (2)\FOO1 - Copy (3)\FOO1 - Copy (4)\FOO1 - Copy (5)\_TEMP\Folder\Folder - Copy (2)\Folder - Copy (3)\Folder - Copy (4)\Folder - Copy (5)\Folder - Copy (6)\
Looks like the first slash of the resulting name is not considered as "root folder of the files drive".
I guess it's because the rename function concatenates the file path with the new name:
"path\"+"\new name"
This works fine with names like "..\new name" relative to the previous path, while the double \\ is simply interpreted as a single directory separator.

Regards
Holger
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

@HolgerK, I do not get the "error cannot rename" in TC 8.0b6 x64

I did not test in x86/32bit.

Appears there is possibly difference in code between the 32bit and 64bit versions for how the input/output is parsed in the MRT.
User avatar
HolgerK
Power Member
Power Member
Posts: 5409
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

Balderstrom wrote:Appears there is possibly difference in code between the 32bit and 64bit versions for how the input/output is parsed in the MRT.
I've found the difference.
I can confirm your first observation with TC80b6(x86 and x64) but only with a fresh ini file.
Using my own wincmd.ini, i'm always getting the error message.
So no difference between x86 and x64 but something from my ini file.

Regards
Holger

Edit:
I've found the culprit:
MrtReplacePluginChars=1
0: Turns off auto-replacement of invalid characters from plugins in the multi-rename tool (e.g. ':' -> '.') -> user has to take care of it himself
Inside my own wincmd.ini this was set to 0 :!:
User avatar
white
Power Member
Power Member
Posts: 5804
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: TC8.0B6 - MRT Bug

Post by *white »

Balderstrom wrote:Given the following folder structure:
C:\_TEMP\FOO1\FOO1 - Copy (2)\FOO1 - Copy (3)\FOO1 - Copy (4)\FOO1 - Copy (5)\FOO1 - Copy (6)\

Browse into the folders, until the cursor is on "FOO1 - Copy (6)"; launch MRT
:MRT:
Rename Mask: [=tc.path][N]
Ext: [E]
Search: FOO1
Replace: Folder
TC claims that the New Name will be:
C:\_TEMP\Folder\Folder - Copy (2)\Folder - Copy (3)\Folder - Copy (4)\Folder - Copy (5)\Folder - Copy (6)\
TC does not claim that. Look carefully at the second character. TC does not allow ":" in the file name mask so it is translated into "."
(See HolgerK's remark above)

HolgerK wrote:Looks like the first slash of the resulting name is not considered as "root folder of the files drive".
I guess it's because the rename function concatenates the file path with the new name:
"path\"+"\new name"
This works fine with names like "..\new name" relative to the previous path, while the double \\ is simply interpreted as a single directory separator.
Yes, I had noticed that too while testing something else. In my opinion it would be more intuitive when renaming to \something would mean renaming to root\something, similar as when using in place rename. However, if Ghisler decides to implement renaming to root, care should be taken to determine what the root is for local drives, ftp connections, \\?\d:\, etc.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50517
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Hmm, I don't understand the problem, what should I change?
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5804
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

ghisler(Author) wrote:Hmm, I don't understand the problem, what should I change?
I think the bug described by the topic starter does not exist and this thread may be moved to English forum.
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

I had thought it was a way to rename a directory structure when You use [=tc.path] to access the full path. I missed that it was replacing C:\ with C.\

Not sure why you would want to do what the actual behaviour is though.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
HolgerK
Power Member
Power Member
Posts: 5409
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

It would be clearer if column "Location" were directly shown before the column "New name".
On the other side: relative path renaming (moving) is not the 95% percent use case of the MRT.

Regards
Holger
Make our planet great again
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50517
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The problem with column "location" is that it can become extremely long, so I put it at the end.
Author of Total Commander
https://www.ghisler.com
Post Reply