Author Topic: File comparision with archive support  (Read 20568 times)

jnarew

  • Newbie
  • *
  • Posts: 2
    • View Profile
File comparision with archive support
« on: February 17, 2015, 12:03:51 »
Hello Mathias,
Thanks for MC. Now it becones a great tools as TC ;-) 

My Request:

Comparision file content with archives support.

I found solution by macro: ( thread http://forum.multicommander.com/forum/index.php/topic,654.msg1751.html#msg1751 )
but this :

@var $cmd = "D:\\Programs\\WinMerge\\WinMergeU.exe";

@var $selectedPaths = GetSelectedPaths();
@var $path1;
@var $path2;
if (arrayCount($selectedPaths) == 2)
{
  $path1 = $selectedPaths[0];
  $path2 = $selectedPaths[1];
}
else
{
  /*$path1 = GetSourceFocusPath();*/
  /*$path2 = GetTargetFocusPath();*/
  $path1 = GetTagValue("${leftfocuspath}");
  $path2 = GetTagValue("${rightfocuspath}");
}

MC.Run CMD="{$cmd}" ARG='"{$path1}" "{$path2}"'


can't utilize archived files

I tried extending by studying macros API but giveup.


Best Regards
Janusz, Poland

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4492
    • View Profile
    • Multi Commander
Re: File comparision with archive support
« Reply #1 on: February 17, 2015, 12:43:24 »
Problem is that full paths of the files are sent to WinMerge and WinMerge can't open a file inside a archive.
You need to copy the file from the archive to a temp locations first.

jnarew

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: File comparision with archive support
« Reply #2 on: February 17, 2015, 15:42:44 »
Thanks for quick answer,

Can You suggest me elementary script commands / code that:
a) Check if in panels source or target display archive content.
b)  Extract (copy) highlighted file (source/target) to temporary folder.

I try  test extending macro .

Regards,
Janusz 

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4492
    • View Profile
    • Multi Commander
Re: File comparision with archive support
« Reply #3 on: February 17, 2015, 18:06:01 »
There is no easy way to check that. you can get the complete path and check if the path part has .zip or .rar  (or what archive it now is) in the path.

so if the path is "C:\MyFolder\MyArchive.zip\MyFolder\myfile.txt"  Then the file is located inside an archive.

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4492
    • View Profile
    • Multi Commander
Re: File comparision with archive support
« Reply #4 on: February 17, 2015, 18:07:39 »
or you can do the opposite. check if the filepath really exists (real file)

Code: [Select]
@var $res = FileExists("C:\\temp\\MyFile.txt");if $res get the value 1 then the file exists on the normal filesystem