Toolbar "%Z%C1 %Z%C2" cuts of archive subdirectory on filename match

Moderators: Hacker, petermad, Stefan2, white

Post Reply
crash5
Junior Member
Junior Member
Posts: 4
Joined: 2023-02-21, 19:21 UTC

Toolbar "%Z%C1 %Z%C2" cuts of archive subdirectory on filename match

Post by *crash5 »

By default, if i select a file in one panel and press compare by content it will automatically selects the file with same name from the other side.
The toolbar button parameter should do the same with "%Z%C1 %Z%C2".

It works if the sides are not inside an archive, but if both sides in an archive, and the file i want to compare are under a sub directory inside the zip file, the custom toolbar button version cuts off the subdirectory from the other side's file path.

Eg: for zip files a.zip and b.zip, and file under the directory "subdir", when i am in the subdir on both sides and the cursor is on the file in the a.zip's side i get a.zip\subdir\readme.txt and b.zip\readme.txt instead of the b.zip\subdir\readme.txt

With the internal compare by content it works.
If I explicitly select the file on both sides it works with the custom toolbar too. So possible something wrong with the "filename match" part of the thing for archives.
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Toolbar "%Z%C1 %Z%C2" cuts of archive subdirectory on filename match

Post by *petermad »

Confirmed

If I use a button like:

Code: Select all

TOTALCMD#BAR#DATA
%COMMANDER_EXE% /i="%COMMANDER_INI%" /S=C
%Z%C1 %C2
wcmicons.dll,49
menu=Compare Contents (separate instance)


-1
To make the button:
1. Mark the text in the box here above (click SELECT ALL).
2. Copy it to the ClipBoard (press Ctrl+C).
3. Right click on TC's buttonbar and choose "Paste".
Then if one or both sides are inside an archive, I get the message: "Left file not found!" or "Right file not found!".

For me it does not matter whether the file in the archive is in a subdir or not.

If I have for example these two files:
c:\test\file.txt
c:\test\file.zip

and inside c:\test\file.zip is the file file.txt but with a different content than c:\text\file.txt, then if I have the cursor on c:\test\file.txt on the left side and i have c:\test file.zip opened on the right side, then the two paths shown when I use cm_IntCompareFilesByContent are:
c:\test\file.txt
C:\TEMP\_tc\file.txt

But if I use the button here above these paths are shown:
c:\test\file.txt
c:\test\file.zip\file.txt

So with the customized compare button the archive file is not recognized as such and is therefore not unpacked to be compared.

But I would categorize this a missing feature rather than a bug.

If I inside the c:\test\file.zip file also has a subdir with a file.txt file inside - I can confim that the path is only shown as c:\test\file.zip\subdir\file.txt when I explicitly select the file c:\test\file.zip\subdir\file.txt (or make the right side the active side and place the cursor on file.txt) - otherwise c:\test\file.zip\file.txt is shown - This I consider to be a bug!

If I replace %C2 with %T%M and don't mark c:\test\file.zip\subdir\file.txt the path is shown correctly for the right side.


2crash5
"%Z%C1 %Z%C2"
You don't have to repeat the %Z parameter, one time is enough.

If I explicitly select the file on both sides it works with the custom toolbar too.
I guess that you are not using TC as the external compare tool, since this works for you.
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
crash5
Junior Member
Junior Member
Posts: 4
Joined: 2023-02-21, 19:21 UTC

Re: Toolbar "%Z%C1 %Z%C2" cuts of archive subdirectory on filename match

Post by *crash5 »

I used the orignal compare by content button for the internal compare. That worked for me.

I only have the problem when I try to use an external app for the compare, that is when the "match the file from other side with the same name" don't work.
Easier to test with a dummy button with the parameter set to "?%Z%C1 %C2", so you can see that it cut off the subdir part from the second path. I think that is the problem when you try it with a custom internal compare button too, it don't get the proper path in this case from the passed parameters.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Toolbar "%Z%C1 %Z%C2" cuts of archive subdirectory on filename match

Post by *ghisler(Author) »

I agree that %C2 should contain the archive subdirectory. However, this will not help you here because the compare tool can't unpack files by itself, this is done by cm_CompareFilesByContent before calling the compare tool.
Author of Total Commander
https://www.ghisler.com
crash5
Junior Member
Junior Member
Posts: 4
Joined: 2023-02-21, 19:21 UTC

Re: Toolbar "%Z%C1 %Z%C2" cuts of archive subdirectory on filename match

Post by *crash5 »

My problem is only that the %C2 is missing the subdirectory, I use it with an external tool not with the internal compare.
Post Reply