[7.56a] MRT: problems with trailing backslash

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

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
white
Power Member
Power Member
Posts: 5785
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

[7.56a] MRT: problems with trailing backslash

Post by *white »

Select some files and start the Multi Rename Tool.

Code: Select all

Search for:    .*
Replace with:  .new\

RegEx not checked
When trying to rename, Total Commander reports the renaming has failed. But when you close the Multi Rename Tool the files do seem to be renamed. Start the Multi Rename Tool again and press the Undo button. Undoing the rename operation fails.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

What the reason to use such rename template? It is impossible to append slash to filename, it is a forbidden character.

However, I can confirm that files are renamed but TC reports failure.
User avatar
white
Power Member
Power Member
Posts: 5785
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

MVV wrote:What the reason to use such rename template?
The reason maybe a simple mistake. Maybe a user will try to move files to sub folders and makes a mistake. Too bad if he accidentally renamed numerous files and can't undo. Note that the expression mentioned earlier is very simple to illustrate the problem. But it can also be an expression where it is not easily seen if some file names will end with a backslash.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50475
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Apparently the Windows rename function reports an error although it does rename the file - odd indeed. I don't think that I can do anything about it, or should I forbid backslashes in general?
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5785
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

ghisler(Author) wrote:..or should I forbid backslashes in general?
Please don't forbid backslashes in general. The possibility to move files across folders using the Multi-Rename Tool is highly valued.

You could simply remove trailing backslashes from destination just before actually renaming a file.

You could also check what error is returned (what is the error returned btw?), if the known error is returned check if destination has a trailing backslash, if so check if source does not exist and destination (without backslash) does exist, if so it may be safe to assume the operation was a success :-)

BTW. I noticed folders are moved without error to a name with a trailing backslash. Undo also works in that case. Although the original name mentioned in the dialog (nothing) is not quite right.
User avatar
white
Power Member
Power Member
Posts: 5785
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

Tested using TC 8.0b3-32. A maximum of one trailing backslash is removed. I've created a new bug report for the cases where there are multiple trailing backslashes. So this report can be moved to Fixed bugs.
Post Reply