Copyright: WinXs® 1995 Mick Meaden


Contents

Introduction

This program provides various mechanisms for comparing the contents of two files, as follows:

•	Binary comparison.  This provides a Windows implementation of the UNIX cmp(1)  and dircmp(1) commands.  The cmp(1) command performs a binary comparison of two files and identifes the first line and byte position at which they differ (if any).  The dircmp(1) command compares the contents of two directories, performing a binary comparison on files that existing in both directories.

•	Text comparison (UNIX diff format).  This provides a Windows implementation of the UNIX diff(1) command, which will compare the contents of two text files and list the differences in terms of UNIX-like editor commands.

•	Text comparison (DOS FC format).  This provides a Windows interface to the DOS File Compare (FC) utility.  Like diff(1), this program will compare two text files and list the differences (if any), although the output tends to be more easily understandible than that produced by diff(1).

Whichever command is chosen, results are displayed in the output window, which is a readonly Edit Control that can be scrolled, copied or printed.

Procedures

On invocation, the user is presented with a dialog box that names the files for comparison and defines various options for controlling how the files are compared.  This dialog can be re-invoked at any time by selecting the New option on the File menu.

Reference

cmp

diff

fc

Dialog

Menus


cmp

NAME

cmp - UNIX binary file comparison

SYNOPSIS

cmp filespec1 filespec2
cmp dirspec1 dirspec2

DESCRIPTION

In the first form above, where two filespecs are specified, this program peforms a binary comparison of the two named files and displays a single line indicating either:

•	the byte and line number of the first bytes that differ, or

•	a line indicating that the files are identical.

In the second form, where two dirspecs are specified, this program will compare the contents of the two named directories.  Where the same file exists in both directories, a binary comparison will be performed as indicated above.  Where a file only exists in one directory or another, a line will be output giving the name of that file and the name of the directory in which it exists.

SEE ALSO

dialog


Dialog

The Diff for Windows dialog box presents the following options

File1

File2

Name of the files to be compared.  If this program is invoked from the WinXs menu in File manager, and a file is currently selected, the name of that file will appear in "File1".

Browse1

Browse2

Invoke the standard Windows open file dialog for "File1" and "File2" respectively.

Show Line Number

If checked, all displayed lines will be preceded by a line number.  This option only applies to the FC command.

Ignore Case

If checked, the case of letters is ignored during comparison.  This option does not apply to cmp(1).

Ignore White-Space

If checked, tabs and spaces are compressed during comparison; that is, if a line contains many tabs or spaces, diff(1) and FC treat these characters as a single space.  This option does not apply to cmp(1).

Type

These radio buttons determine which type of file comparison should be performed; that is, using cmp(1), diff(1) or the DOS FC command.  The appropriate button will be preset when the program is invoked from the WinXs menu in File Manager.


diff

NAME

diff - UNIX text file comparison

SYNOPSIS

diff [-b][-i] filespec1 filespec2

DESCRIPTION

This program will compare the contents of "filespec1" and "filespec2" and display the results in the output window.  Options can be set via checkboxes in the main dialog and have the following meanings:

  -b	Compresses tabs and white-space during comparison
  -i	Ignores the case of letters during comparison

Output is in the form of one or more UNIX-like context editing commands which take the form:

<range><action><range>

where <range> may contain a single line number or a comma-separated line range (e.g., 2,4).  A line number or range appearing before the action refers to lines in "filespec1", while those appearing after <action> refer to lines in "filespec2".

The <action> is a UNIX-like editor command, which will be one of "a" (append lines), "d" (delete lines), "c" (change lines).  The aim of these is to identify what editor commands would need to be used to convert "filespec1" to "filespec2".

Following each of these lines, diff(1) will display all lines affected in the first file preceded by a '<' character, followed by all lines affected in the second file preceded by a '>' character.  If there are lines affected in both files, as with the "c" command, the changes are separated by a line consisting of three hyphens ("---").

SEE ALSO

dialog


fc

NAME

fc - DOS file comparison

SYNOPSIS

fc /t [/n][/w][/c] filespec1 filespec2

DESCRIPTION

Compares two files in text mode and displays any differences between them.  Differences are reported by displaying the first filename, followed by the lines that differ between the files, followed by the first line to match again, followed by similar information for the second filename.

The various options are controlled by checkboxes in the main dialog, as follows:

  /n	Displays lines numbers in the output.
  /w	Compresses tabs and white-space during comparison
  /c	Ignores the case of letters during comparison

If a wildcard is used in "filespec1", FC compares all the specified files to the file specified by "filespec2".  If a wildcard is used in "filespec2", FC uses the corresponding value from "filespec1".

SEE ALSO

dialog


Topic1
Menus

File Menu

New

Invokes the Diff dialog to begin a new file comparison.

Save As...

Save results to a file.

Print

Sends the contents of the output window to the current printer.

Print Preview

Previews the current contents of the output window as they will appear when printed.

Print Setup

Invokes the standard Windows Print Setup dialog.

Edit Menu

Copy

Copy the current text selection to the Windows clipboard.

Help Menu

Contents

Display the contents topic of this help file.

About DIFF

Display program name, copyright and version number.