Guides/Directory Match

From J Wiki
Jump to navigation Jump to search

The Directory Match utility compares directories, and is particularly useful for comparing old and new versions of scripts.

(There were minor changes made to Directory Match in library version 6.02.030 and this description applies to the new version.)

Directory Match Dialog

Enter the source and target directories, either:

  • directly
  • from the drop-down list of the last 15 directories referenced
  • from the browse button (Windows only)
  • from menu item: Favorites|Select from favorites...

Swap the two directories using menu item: Tools|Swap source and target directories.

Type selects the file extensions of files to be compared. Use the browse button to configure the selections.


  • Include subdirectories
  • Compare timestamps - if selected, then files that have the same contents but different timestamps are shown. Otherwise, only file contents are compared.

Clicking Match compares the directories and displays a list of different files.

This enables some or all of the following buttons:

  • Compare - compare a pair of source and target files, selected by placing the cursor on one of the filenames
  • Compare All - compare all source and target files
  • External Diff - as Compare but using an external differencing program (see below)
  • Open - open in the J development session (if available)
  • View - view file
  • Copy - copy from source directory to target directory (if appropriate)
  • Ignore - remove file from display



This menu choose the type of source files, one of

  • Source from Directory - select a pair of normal directories
  • Source from Snapshot - compares a directory with a Project Manager snapshot
  • Source from Subversion - compares a directory with its Subversion source


This menu lets you save and edit favorite directories to compare.


The view menu configures the displayed file list:

  • Contents only - show only those files whose contents differ
  • Ignore target files not in source
  • Ignore source files not in target
  • Ignore source files earlier than target

Compare menu

The compare menu configures the Compare and Compare All buttons.

  • Detail compare ignores line separators (particularly useful for comparing Windows and Linux source)
  • Detail compare ignores leading and trailing whitespace

Tools menu

Various tools:

  • Swap source and target directories
  • Copy source files not in target - copies the files from source to target directories
  • Copy source files later than target - copies files with later timestamps from source to target directories
  • Copy all source files - copies all files from source to target directories
  • Delete target files not in source - deletes the files
  • Print - prints the current file list on display

External Diff

An external differencing program may be used if previously configured in menu Edit|Configure|External Programs|File Comparison. Any such program will do, and the following free programs are known to work well:

  • Linux Meld
  • Windows WinMerge - for this, set custom codepage 65001 in Edit|Options|Codepage to enforce utf8


If you are using the subversion version control system, then this keeps a copy of the last checked out source in subdirectories .svn. In Directory Match, select menu File|Source from Subversion to match the target directory against the subversion source