1

I'm trying to use 010 Editor v8.0.1 as the diff program for binary files in P4V, especially those which I have a template script for (eg, EXEs).

According to the -compare documentation on 010's site, the commandline I want to use is -compare:%1::%2::\e\t.

I'm using P4V's assign diff applications by file type using the above code for the arguments value.

The problem is, P4V will not replace the positional arguments %1 and %2 when there are non-whitespace characters before and after them. If I put a space before and after P4V will happily replace them with the desired files I want to diff. However, 010 Editor cannot handle this format.

What can I do to solve this incompatibility for Windows systems?

kornman00
  • 808
  • 10
  • 27

1 Answers1

1

You can work around this incompatibility by creating a .bat file to pipe the P4V provided arguments in a way 010 will happily eat them. Save the below script to a file named 010EditorP4Diff.bat, then set P4V to diff your desired file extension using this bat script path as the "Application" path and %1 %2 as the "Arguments" value.

I've also included a way to shortcut launching binary templates based on the first file's extension. As of the latest version of 010 Editor (v8.0.1), the -template parameter will only apply to the %2 file. You will need to manually open the Template Results view (Alt+4) and run the desired template (F5, select from the list) for the first file.

This of course assumes you have installed the EXE.bt template from the 010 editor repository.

REM https://www.sweetscape.com/010editor/manual/CommandLine.htm#-compare
echo off
set arg1=%1
set arg1_extension=%~x1
set arg2=%2

REM Sadly, as of 010 v8.0.1, the template only auto shows up for the arg2 file :[
if      %arg1_extension% == ".exe"  goto EXE_TEMPLATE
else if %arg1_extension% == ".dll"  goto EXE_TEMPLATE
else                                goto NO_TEMPLATE

:EXE_TEMPLATE
start 010editor -compare:%arg1%::%arg2%::\e\t -   template:"%USERPROFILE%\Documents\SweetScape\010 Templates\Repository\EXE.bt"
goto GETOUT

:NO_TEMPLATE
start 010editor -compare:%arg1%::%arg2%::\e\t
goto GETOUT

:GETOUT
kornman00
  • 808
  • 10
  • 27