Multi Commander Support Forum

Multi Commander => Script => Topic started by: jnarew on February 17, 2015, 12:03:51

Title: File comparision with archive support
Post by: jnarew 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
Title: Re: File comparision with archive support
Post by: Mathias (Author) 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.
Title: Re: File comparision with archive support
Post by: jnarew 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 
Title: Re: File comparision with archive support
Post by: Mathias (Author) 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.
Title: Re: File comparision with archive support
Post by: Mathias (Author) 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