File Comparison

Path Finder sports the file comparison command, that let you easily access your favourite file comparison tool and use it to compare files selected in Path Finder browser window. There are three ways you can access this command:

1. Select exactly two items in Path Finder browser window and show contextual menu (left mouse click + ctrl, or right mouse click). Click the Compare… menu item (see the picture below).

picture1.png

Please note that Compare… menu item will appear only if exactly two items are selected and they are of the same type (both files, or both folders). If any of those conditions is not met, the comparison menu item will not appear.

2. You can do exactly the same as in 1., but from the action menu (see the picture below).

picture2.png

3. If you are in the Dual Pane mode, select exactly one item in each pane. Then go to the main menu and click Commands > Compare Selected Items… (see the picture below).

picture3.png

Please note that Compare Selected Items… menu item will be enabled only if exactly one item is selected in each pane and they are of the same type (both files, or both folders). If any of those conditions is not met, the comparison menu item will be disabled.

Although Path Finder provide this easy way to select files for comparison, it doesn't actually compare files. The actual comparison is done by comparison tool of your choice. You can select which tool to use for file comparison in the Path Finder preferences panel, tab Features, section File Comparison (see the picture below).

picture4.png

By default, Path Finder tries to locate if Xcode or system file comparison tool opendiff is installed and if it is, it automatically sets it to be used for file comparison. That situation is show in the picture above. The situation when no comparison tool is set is shown in the picture below.

picture5.png

Regardless of whether the comparison tool is set or not, you can always change it to your favourite one. Click the Select tool… button and in the file selection sheet that appears, select the location where your favourite comparison tool is installed.

It is very important to know which kind of comparison tools you can use with Path Finder. It is NOT possible to select a regular application bundle (with .app extension). The tool you select must be a command line tool, which can be started with two files (to be compared) as arguments:

comparison_tool_name file_path_1 file_path_2

If a tool you chose is not a command line tool, or it cannot be started the way shown above, it WILL NOT work with Path Finder. Luckily, majority of modern and popular file comparison tools are used to indicate file differences in version control systems (Git, Subversion…), which in turn invoke comparison tools the above mentioned way. That's why we have chosen Path Finder to do the same.

Here we will mention a couple of popular file comparison tools and how they can be set to work with Path Finder.

FileMerge

The chances are pretty high you have FileMerge installed on your system, especially if you've installed Xcode or some other development tools. FileMerge (which is actually the application bundle) is invoked the way we need by the opendiff tool:

opendiff file_path_1 file_path_2

opendiff tool is usually installed in /Applications/Xcode.app/Contents/Developer/usr/bin/opendiff or /usr/bin/opendiff

Kaleidoscope

Kaleidoscope is also an application bundle, but it offers so-called integration feature, where you can integrate it with other programs. Go to Kaleidoscope's the main menu, select Kelaidoscope > Integration… and in the window that appear select Kaleidoscope Command-line tool (see the picture below).

picture6.png

This picture says it all. Once you've installed the ksdiff tool, go back to Path Finder preferences and choose /usr/local/bin/ksdiff as a file comparison tool used by Path Finder.

Araxis Merge

Araxis Merge comes with menu command line utilities in the Utilities folder inside its application bundle. The one we need is araxisopendiff (see the picture below).

picture7.png

Araxis Merge can be started with this tool like:

araxisopendiff file_path_1 file_path_2

Copy this tool somewhere (e.g. /usr/local/bin) and then set its path in Path Finder preferences. Path Finder will then use Araxis Merge to compare files.

Other programs

If you would like to use some other application for file comparison and start it from Path Finder, please refer to that application documentation or support staff. It will work with Path Finder if it can be invoked with the command line tool, like explained in this article.