Renaming multiple files with cm_RenameOnly and ‘/’

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
now
Member
Member
Posts: 181
Joined: 2006-11-01, 08:34 UTC

Renaming multiple files with cm_RenameOnly and ‘/’

Post by *now »

When renaming multiple files with cm_RenameOnly you can use a backslash ‘\’ to rename files to a folder, for example “..\*.*” will move all selected files to the parent folder. Using the “alternate” path separator (because it does work like one) slash ‘/’ also works, but destroys the file name. Expected behavior would be for “../*.*” to act the same way as “..\*.*” (and any similar path specification).
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Can you give me an example of what you use as rename string, please?
Author of Total Commander
https://www.ghisler.com
User avatar
now
Member
Member
Posts: 181
Joined: 2006-11-01, 08:34 UTC

Post by *now »

Create a directory called “a” and two files called “123” and “456”, respectively. Then select both files and enter “a/*.*” in the “Rename/Move 2 file(s) to” dialog and execute. You will now have file called “3” and a file called “6” in the directory called “a”.

If you use “a\*.*” instead you wind up with two files called “123” and “456”, respectively, as expected.
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

Confirmed, the same with copy/move via F5/F6.

It seems that always the first two characters of the file name are killed:
File "12345678.123" gets "a/3456789.123".
File "12.345" gets "a/.345"

File "12" produces an error message (Screenshot, target was a/*.*):
Cannot write [path]\a/!
Please remove write protection!
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
now
Member
Member
Posts: 181
Joined: 2006-11-01, 08:34 UTC

Post by *now »

Well, typing a longer subdirectories name chops of more characters, that is, “ab/*.*” will chop of three instead of two. So the renaming algorithm doesn’t discount the characters before (and including) the slash, where it would have done it had we written “ab\*.*”.
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 TC sees the slash as a part of the name of the file - only windows itself later interprets it as a directory delimiter...
Author of Total Commander
https://www.ghisler.com
User avatar
now
Member
Member
Posts: 181
Joined: 2006-11-01, 08:34 UTC

Post by *now »

OK. Can this be fixed? As Windows interpret both ‘\’ and ‘/’ as directory separators, it makes sense if Total Commander would do so as well.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I will consider this - but it would require a lot of changes in 1000s of places in the program...
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 »

Fixed in TC 7.03
(Win2k SP4, using my test scenario)
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Great, thanks!
Author of Total Commander
https://www.ghisler.com
Post Reply