DELTA DELTA

Version 2

User's Manual




























OPENetwork

Brooklyn, New York








Copyright © OPENetwork, Inc. 1994-2001

          
All Rights Reserved. No part of this document may be reproduced without the express written consent of OPENetwork, Inc., except for brief excerpts for the purpose of critical review.

License

          
delta used to be under a proprietary license. It will be soon released under an open source license. Currently the source is not yet released but the binaries distributed with this manual are free for unlimited non-commercial use.



This documentation was prepared with LATEX on a PC, with a 600 dpi Postscript printer. Mi-Shell was instrumental in speeding up the cycle of programming and viewing the results.

Preface

``An effort is never wasted.''

Elie Chetrit













Ever since 1976, unix programmers have used ``diff'' for their file or directory comparisons. MS-DOS users had to do with inferior tools until around 1989 when MKS and OPENetwork both ported unix commands to MS-DOS under the names of MKS Toolkit and The Berkeley Utilities.

When shortly thereafter, a friend repeatedly failed to understand the output of ``diff,'' I realized there was room for a simple and intuitive comparison tool. John Lowenthal undertook the project and came up with a brilliant addition: the artificial intelligence engine which works so smoothly in the background that delta users hardly ever notice it. Since then, delta has been the leading comparison tool for MS-DOS-based platforms.

Since 1994, Jean Michel, who had written the Berkeley Utilities ``diff,'' completely revamped the product, speeding it up, simplifying its user interface and adding many features.

Still delta is a product in transition and we need your feedback to make it what we want: the indispensable programmer's companion. We want to know who you are and how you work. The author welcomes any queries at jmichel@math.jussieu.fr




Jean-Claude Chetrit

Fall 1996

Chapter 1
Quick Start

``Vive la difference!''

A frenchman

















delta is a comparison tool for serious users of MS-DOS compatible systems such as Windows and OS/2 and particularly for programmers and power users. It has now also been ported to the LINUX operating system.

You can start using delta right away because it is easy to use. However, there are probably some features you will not discover unless you use the on-line help or read the manual.

1.1  Overview

There are 3 steps for using delta:
  1. Select either 2 files or 2 directories to be compared To do so,
    • type delta object1 object2 on the command line, OR

    • type delta on the command line, then chose or type object1 and object2 on the entry screen, OR

    • type delta on the command line, then chose both objects in the entry screen by typing their name or browsing through directories.

      Figure 1.1: The Entry Screen

  2. The comparison itself:

    • If you compare 2 files, delta will show you the files aligned with each other and highlight the differences.

      Figure 1.2: The File Comparison Screen

    • If you compare 2 directories, delta will display both directories, with equal files or subdirectories separated by = and different files or subdirectories separated by < (less recent) or > (more recent). Using the directory comparison, you can compare 2 different files (with the same name) by moving the cursor to that filename and hitting Enter.

      Figure 1.3: The Directory Comparison

  3. Change the comparison options:

    F6 or Options menu, submenu Comparison Options allows you to change delta's options such as ignore whitespace, ignore case, etc... then F10 to save the options for the current session. You can also save these options in a permanent configuration file.

1.2  System Requirements

A computer equipped with color EGA, VGA or SVGA, running MS-DOS 3.x or higher, or any version of Windows. A hard disk and 640K are highly desirable although not necessary.

1.3  What you can get

1.4  Installation

Installation just consists in putting the executable and the manual in some convenient place.

1.5  Setting up your video

delta can use any screen width and height in a MS-DOS box or in full-screen MS-DOS, or any X-Windows xterm, provided it has at least 80 columns and 25 rows. You may want to chose a wider display to show two files side-by-side. Under MS-DOS or windows you may or ask delta to change the display, either by typing delta -lnn where nn is 25, 43 or 50 specifying how many lines you want. Or you should find which text modes are supported by your video chip in the disk or manual which came with your video card. Or if not, you may be able to get the information from the Internet or from the card manufacturer's BBS. Then use delta -Vn where n is the mode you wish to try. For instance, with the Tseng ET4000 chip,
   delta -V33 
gives you 132 columns by 60 lines text mode. After a few experiments, make the best video choice your default by saving it in delta.cfg.

1.6  Navigating the menus

It is not necessary to have a mouse to use delta. You can get around the menus using the keyboard: Alt + the highlighted letter in the menu name or entry name goes there. Once inside a menu, you can also navigate with the cursor up and down keys, and chose an entry by hitting Enter. Most menus have contextual help which shows on the bottom display line.

1.7  Setting up your editors

From the comparison screen, go to the options menu down to the entries ``editor'' and ``edit both.'' Type in the name of your ASCII editor. Go down to ``save options'' and save your changes to the file the program will suggest. More details will be given in section .

1.8  You must read this

We know you are in a hurry: assuming you got and unpacked demo.zip somewhere, go there and compare directories old and old by typing:
   delta old new 

Now, make things as visible as possible: go to the Options menu, submenu Color, v to get to the ``visible'' color scheme, and hit Enter to accept this choice. You can also type AltO-c-v-Enter.

These are the files in OLD and NEW:

Chapter 2
Fundamentals

``Faithfulness to fundamentals seems to be a common

thread linking professionalism in all areas.'' Toshiro

Kageyama, Lessons in the Fundamentals of Go













2.1  General Conventions

Some of the conventions used in this manual are typical in software manuals, while others are not:

2.2  The screens of delta


File Browser Dir. Browser _F3
Entry ^F3 ^<<<<<Enter Dir. Comparison ^Enter _F3 _F3
File Comparison
Map of main screens


Besides its main screens, delta has a few side screens:

Finally from most main screens, you can shell out to MS-DOS with F9 (or under LINUX go to a new shell), do a few things, then type exit to return to delta.

2.3  The entry screen

This was described briefly in section 1.1, but is elaborated on here. In particular, we will look at how you can type in file or directory names or navigate to them. When you are in the entry screen, you can navigate by using the cursor keys, Enter to enter a subdirectory, or Tab to go to the other panel. When you are statisfied with your choice, hit F10 to start a comparison. You can also edit directly the file name above the current panel by hitting AltP. You can enter a wildcard there, and only the files which match will be shown. You can also use this to change drives, by typing a name starting with a drive specification (like D:). Browsing (key F3) a directory means go there (attach to it, change the default directory to it), and display the directory again (navigating is another term for it). Browsing a file means call the built-in browser (also called paging, more, etc...).

Figure 2.1: The entry screen

Changing the display

Moving around

Actions

The following table is critical in understanding the selector.

When the cursor When the cursor
is on a directory is on a file
F3 browse browse
Enter browse select
F10 select select

If you stick to F3 for browsing and F10 for selecting, you will not risk any confusion.

You leave the browsing of a file with q (for quit) or Esc, but when you leave the browsing of directory, it is because you either selected an object to be compared or abandoned your selecting (Esc).

2.4  What's in that file? (the file browser)

The file browser lets you conveniently page up or down and search for patterns. If you have previously used either the program more of The Berkeley Utilities or Mi-Shell's built-in pager, you are already familiar with our powerful browser. Its many features will be displayed with F1 or h, and are broken down by function:

Moving around

Figure 2.2: The File Browser

Changing the display

It is useful to fully understand the status line at the top of the screen: The second line displays the name of the file you are browsing.

2.5  Comparing directories

As soon as you have selected two directories to be compared, the directory comparison screen will appear and the cursor (highlighted line) will go progressively down the display indicating which 2 files are being compared. When the cursor jumps back to the top, you get control back and you can do one of three things: move around, change the display or act.

Moving around

This is very similar to moving around in the file browser; in addition to the keys to move up, down, page up or page down, you can:

Figure 2.3: The Directory Comparison

Changing the display

Sorting directories

When you are looking at a directory screen, you can sort the entries by Name, Extension, Size or Time by typing Alt-N, Alt-E, Alt-S or Alt-T, respectively or by using your mouse to click on the word name, ext, size or date at the bottom of the directory panel. The sort will apply to the side where the cursor is located. You can achieve a primary sort by Extension together with a secondary sort by Size within Extension by typing Alt-S, then Alt-E.

Display toggles

The view menu shows a certain number of items ticked or not, which correspond to the marker to the right side of the entry names. They are associated to the keys = < > l r. A checkmark on the menu line indicates that the corresponding kind of files (described just below) are currently being shown; by choosing the menu entry or pressing the corresponding key, you also toggle whether you want these kind of files are shown:

Pressing F4 will toggle between displaying all the files (i.e. =<>lr) and displaying only unequal files (i.e. <>).

Actions

2.6  Comparing files

Changing the display

In the default configuration shipped to you, black on white refers to lines identical on both sides, while color points out differences. Please take some time to understand these colors, or the ones you eventually choose as your own.

Similarly, it is useful to master the status line at the bottom of the screen, which we repeat here even though it is almost the same as the one at the top of the file browser screen:

Figure 2.4: The File Comparison Screen

Moving around

Actions

You can:

2.7  Printing with delta

There are two ways to create a written record of the differences between two files:
  1. From the file comparison screen, F7 or menu File, print calls the print menu. The printed comparison will always look like a side by side display. The print menu has 3 items:
    • file you wish to print to: the default is prn which sends the output directly to the printer. We recommend you type a name and browse through your output before printing. It will save a few trees and be less frustrating, as you discover you actually wanted something slightly different.

    • number of lines per page: change it if you use a special paper size or font, or can print in landscape mode.

    • number of characters per line: this should be changed if you can print in landscape mode.

2.8  Changing the options

If the comparison you get of your 2 files does not seem entirely satisfactory, it is time to roll up your sleeves and make delta work better for these files. Sometimes, it is obvious that changing the ignore case option (F6 or Options menu, submenu Comparison Options) will solve the problem, sometimes it is much harder to find the answer. We recommend you first read the tutorial in section 1.8.

Other options

2.9  The configuration file

delta can work with different configuration files:

Similarly, when you wish to save the options you have modified, we recommend you use the name suggested by the prompt, i.e. .cfg in the directory where .exe is located, but you can change this name at will (you may, for instance, want to have certain options saved for your ``C'' work and some others saved for your database work).

Under MS-DOS, you can save the options while the configuration name is blank. That will cause the default settings of delta to be changed permanently. Yes, the executable will be changed! which may toggle a virus warning or drive your network administrator crazy, so please use carefully and don't try it if you don't understand the above remarks.

Chapter 3
Smart Backups

``One must imagine Sisyphus happy!''

Albert Camus, in The Myth of Sisyphus


















You have heard ``Backup!'' many times, but now that you have delta, you can do it intelligently. The strategy we propose is nothing more than common sense.

3.1  Many full backups?

Let us assume that you can afford to backup everything frequently. Should you do it? Please think about it before looking at the answer below. On the upside, you will never lose anything; the downside is lots of backups to manage. Well, the answer is no, you should not! What you must do instead is backup your ``DATA'' and make sure that your ``PROGRAMS'' have not changed! We're going to explain these two words in detail.

3.2  Two kinds of files:

Your hard disk contains 2 kinds of files. The first kind (``PROGRAMS'') are the programs and their setup. Since you spent time and effort making the programs work well, you want to prevent them from changing without your permission and understanding. But if you lose these files, it is not catastrophic because you can always reinstall the programs. We call the other kind of files the ``DATA.'' They are the result of your working with the programs: your writings, your spreadsheets, your source code and even your compiled programs if you are a programmer, etc... It is critical to preserve these files because they are not replaceable. If your computer is stolen, and you have no backup, no amount of money in the world can ever recover what is lost.

Separate the two kinds of files:

So, an important priority is keeping ``DATA'' in subdirectories separate from the subdirectories where the ``PROGRAMS'' are installed. We even recommend keeping the two kinds of files on different physical drives because besides simplifying backup issues, it will also increase the performance of many large programs! If you tend to work at the MS-DOS prompt and want a way to make that task easier, we recommend you try our shareware program called Mi-Shell (it resembles Norton Commander).

The initial full backup:

There are many kinds of backups, but we'll simplify here and concern ourselves only with full backups (also called complete backups) and incremental backups which only save the changes since the last backup. There was a time when a full backup meant 4 to 10 hours and more than 100 floppies. Now, a tape backup is inexpensive (less than $200) and will probably do a great job while you go out to lunch. But a SyQuest or Bernoulli drive is even better because it looks and behaves like a hard disk drive (random access rather than linear access). They are fast and cheap: between 7 and 20 cents a megabyte. Finally, a frequently overlooked backup method consists of keeping several PCs always in sync., an extremely desirable strategy which is described below. For simplicity, we will assume that your backup is a simple and complete copy of your hard disk.

3.3  ``PROGRAM'' changes:

How do you know that a program has changed? MS-DOS provides part of the answer, called the archive bit, but it is not enough for many reasons (some viruses and some software will change files without changing the archive bit). First, let us assume that you have followed our advice and that, for instance, the WordPerfect program is under \wp, that its backup is under \wp.bak and that the data is under \writing. Now, type on the command line:

    delta -r \wp \wp.bak 
The -r means turn on the recursive option, i.e. compare not just these two subdirectories, but also all the ones below them, and below those, etc... If there has been no change, you are all set. If there is a change, delta will show you which directories and which files were changed. It may be serious: a virus attached to wp.com, or innocuous: you installed a fax, but either way, two things are now urgent:

3.4  ``DATA'' changes:

When you work on your PC, you fully expect your ``DATA'' to change. It is nice to have a recent backup while you work. Two months ago, I deleted everything on my home directory because I thought I was on a: but had typed a; instead of a: failing to get there. &@!!&@@!! No problem, I thought, I'll undelete. Alas, my drive was networked and refused. In order to recover, I had to stop the network, undelete, and then reconnect the network: it was a pain and a waste of time. Anyway, backing up your ``DATA'' should be done more or less frequently depending on the importance of said ``DATA.'' We keep our list of clients and financial records on a database. We back it up every day because we can't afford to lose it. But we promised you details, so we'll give you some: we keep a mirror image of the directory on a server; we have 5 diskettes for the last 5 days; every day, we backup the database over the oldest backup of the 5. In addition, we keep a permanent diskette at the end of each month. This is not perfect, but better than the usual no backup at all.

3.5  How I keep several PCs in sync.

Rather than tell you what to do, I'll describe what I do and you can adapt it to your situation.

When I am not consulting:

I do all my work at home. Since my children come every week-end to spend time with me and play their favorite computer games, I do a complete backup before they show up. In my basement is hidden a backup system which contains last week's backup. The PCs are linked via ethernet cards and a LANTASTIC network. I type on the command line:

    delta -r d:/july96.jc c:/ 

then methodically explore all the differences (all my week's work and mistakes), and eliminate them, hence fixing my mistakes and making the backup current.

When my children leave on Sunday night, I type the same command and I can see if they have done any damage.

When I am consulting at a client's office:

I go to work every day, spend all day at my work PC, then come home and frequently spend many hours working at my home PC. Finally, I frequently spend the night at my girlfriend's where I sometimes end up working on her PC.

It is not imperative nor even desirable for these PCs to be identical, what I need is to always have my latest work with me. So, I try hard to keep all my ``DATA'' in various subdirectories below c:\home and I carry a ZIP drive with a copy of c:\home on a ZIP disk.

Whenever I sit down at a different PC, I compare c:\home with the ZIP disk version D:\home and bring them into sync. Whenever I am about to leave a PC, I compare them and again bring them into sync so that I always travel with the latest version.

This process may seem a bit time consuming, but I will now never wonder how old my backup was when my PC crashed (or worse, was stolen). Maybe even more important for me is that I will no longer have the frequent frustration Ï wanted to work on xxx, but forgot it at home."

Technical Details:

A JAZ drive or a SyQuest EZ-135 or EZ-230, or an optical drive, or one of the new gigabyte removable media will do fine too. It is possible to operate with a tape backup, but it is so time consuming that we strongly advise you to get one of these new removable hard disks instead.

3.6  Comparing computers

If the objective is to keep two PCs completely in sync., there are two cases: when they are close to each other, they should be networked (read the first section of the next chapter if they are not); then use delta to compare the two hard disks. When they are in different locations, use a removable hard disk and the technique outlined above.

A harder situation is when the two PCs are similar (but not identical) and you want to solve a mystery. We once wondered in our office why ``ghostscript'' worked well on one PC, but not on the other.

Chapter 4
Advanced use of delta

``You can tell a professional by the

sharpness of his tools.'' Ancient saying
















4.1  Connecting computers inexpensively

If all your computers are already networked, you can skip this section. Otherwise, the hardware needed to connect two of them is a bi-directional parallel cable worth around $ 10 (in a pinch, a serial cable will also work, although not as fast). The software needed is DOS 6.xx or Windows 95.

The method consists in choosing one computer as the one you want to use (we'll call it the client or guest) and in considering the other one as simply a set of distant drives (we'll call that one the server or host).

Two MS-DOS computers

Under MS-DOS 6.xx, on the server, you type at the MS-DOS prompt

   intersvr 
then leave the server alone until you wish to break the connection.

On the client, you add to your config.sys a line like

    device = c:\dos\interlnk.exe 

When you reboot the client computer, the server's drives become available to the client computer with different names, for instance the server's C drive may have become the client's G drive.

Two Windows 95 computers

For Windows 95 computers, this is called direct cable connection. Here, the 2 computers are called host and guest.

A MS-DOS computer and a Windows 95 computer

To connect a MS-DOS 6.xx computer to a Windows 95 computer, you have only one choice: make the client the MS-DOS 6.xx computer as described above. You can then start intersvr on the Windows 95 computer. However you will then be unable to task switch out of it and so use concurrently your Window 95 computer in another way (this is a limitation of Windows 95).

4.2  Command line options...

If you type delta -?, you will get help screens with a summary of the information in this section.

... for delta's non visual mode

The general syntax for delta is

delta [options] [f1/dir1 [f2/dir2]]
If one of the fi's is `-', then ``stdin,'' the standard input (or console) is used: this means that you type the file at the keyboard, ending with a ^Z.

4.3  Running delta in Windows

We recommend that you use your PIF editor to load the MS-DOS prompt and replace command.com by delta.exe, save as delta.pif and exit, then invoke the new pif file. If you have chosen full screen, you are done. If you have chosen a window (i.e. you are in a MS-DOS box), we recommend you maximize the window and change the box's font size to suit your needs. The next time you go in, the settings will be remembered. If you are uncomfortable with the smaller fonts, Ctrl-Enter will toggle you back to a full screen display.

4.4  Wildcard expansion

This is a section out of The Berkeley Utilities Manual. As in MS-DOS (and unix),

As in unix,

Finally, the following extension is unique to OPENetwork's products.

Here are a few examples:

Appendix A
OPENetwork

``Comparaison n'est pas raison!''

``An analogy does not prove much!''
















A.1  Contacting OPENetwork

Our customers have always been our biggest asset, so we always offer

Tech Support

OPENetwork's technical support is provided primarily via e-mail:

open@dti.net

and secondarily via its free 24-hour BBS (718) 638-2239

You can also use our voice telephone (718) 398-3838, but it should mostly be used to make sure we're aware there is a problem which you have documented on our BBS or via e-mail.

Troubleshooting

If you experience trouble, please try to reproduce the problem in different environments (i.e. from a different PC, when you just boot, when you do a clean boot, from a Windows MS-DOS box, with different options, without any configuration file, etc...) then upload your observations, the delta.cfg, and maybe the offending files. If you can compress your files with PKZIP, ARJ or RAR, we prefer it to a bunch of files. Then upload these to our BBS or send them as an attachment to an e-mail to us.

This gives us a chance to think about your problem, reproduce it (particularly if you have included all the relevant problem files) and hopefully resolve it.

Feedback

We want to know how you feel about our software. Of course, we will fix bugs as quickly as we can. But tell us also what you have difficulty with, what is unclear or what you would like to see in the next version. Version 2 of delta will undergo many revisions. Since we don't sell many copies, you have a very important opportunity to influence the future of our product.

Web Page

We maintain a Web Page on the Internet where you can monitor new announcements about delta, bugs found and fixed, new versions, etc... our address there is:

    http://home.dti.net/open/delta.html

A.2  More about delta

delta's history

What's new in version 2

Upgrading from version 1.xx

If you have been using delta all these years, we have tried to preserve many key assignments for your convenience:

However, with added power comes the need to learn a few new tricks and to unlearn a few old ones:

Glossary of ambiguous terms

A.3  OPENetwork's Other Products

Demo versions of our software, together with the best of our shareware and freeware can be found on the demo disk included with this manual or on our Home Page.

A.4  OPENetwork's Team




Jean-Claude Chetrit, our President, consults in applied statistics for Fortune 500 Companies, runs the Brooklyn Go Club, writes the manuals and keeps learning from the masters he is lucky enough to run into.






Stephan Lugert, our emerging technology expert, works on an empirical study of the selfish gene hypothesis (via artificial life) when he is not fine-tuning all our PCs.






John Lowenthal, the author of delta version 1, does contract programming in C++/Windows and is a world class bridge player. He is working on a Windows version of DELTA.





Jean Michel, the author of delta version 2, is based in Paris. He is a research mathematician in group theory by profession, a world class go player and a butterfly collector. He programs in his spare time for relaxation.




Bill Buckley, of Antokas Graphics in the Village, is the talented artist responsible for the professional look of our covers, logos and ads.




Spencer Portée, our youngest recruit, is going to Polytech in Brooklyn. Of course, he is majoring in computer science.

Index (showing section)


Footnotes:

1In MS-DOS versions 5.0 to 6.22, there is an undelete command which can enable you to recover from an accidental delete if you catch it early enough; then again, in Windows, Microsoft took it back.

2This is poorly implemented in DOS: don't try to del *A.*, all your files would disappear!


File translated from TEX by TTH, version 2.73.
On 23 Jan 2001, 02:45.