Advertisement

Logging Program Relives the Past

Share via
RICHARD O'REILLY <i> designs microcomputer applications for The Times</i>

Personal computers allow us to perform many tasks that we could not otherwise do. But there is a certain anxiety attached to all that power. What if we lose a critical file? It happens.

Sometimes files are lost because the computer was turned off before the data file was saved and the program that created it was properly closed. At other times, some combination of keys were pressed that could not be obeyed by the computer and it locked up, preventing the data from being saved. A user error or a bug in the program can cause that, too.

Partial data loss may be just as bad, as when a portion of a document or spreadsheet is inadvertently deleted.

Advertisement

But a new program for IBM and compatible personal computers can, in some circumstances, help you recover from such disasters. Cocoon, $100, from Daybreak Technologies, lets your computer keep a log of every keystroke you make. Then, if the need arises, Cocoon recreates what you lost by using that log to replay the keystrokes.

The idea behind Cocoon is deceptively simple. Just before you enter the program you would normally use, you start the log running just by typing the word LOG in front of the command you use to start the program, as in LOG 123 to start logging a Lotus 1-2-3 session.

From then until you leave the program, every keystroke you make is instantly recorded in a special log file on the hard disk. That process continues until you exit the program for which you started the log. On my PC/AT compatible computer there was no perceptible slowdown in my regular software while the keystrokes were being recorded.

Advertisement

You can log keystrokes for any program you have on your hard disk without interfering with logs of other programs, as long as each program is stored in a separate directory. Cocoon automatically backs up its own log files.

The Cocoon program is known as memory-resident software because once loaded it resides in your computer’s memory alongside the application program--word processor, spreadsheet, database, etc.--that you choose to run. It is a very compact program, requiring only 10 kilobytes of memory in the log phase and 20 kilobytes during the recovery phase, so it will run on virtually any IBM or compatible personal computer with a hard disk. Floppy disk drives are too slow for Cocoon’s log to work.

The only application program use that Cocoon cannot log is that of another memory-resident program such as Sidekick or Hotline.

Advertisement

The idea of logging keystrokes is simple and it really does work, but there are some big potential problems that you need to be aware of.

Because all Cocoon does is record keystrokes, it doesn’t know anything about the context in which those keys were hit. It can’t read your computer screen the way you can.

Here’s how you can get into big trouble. Say you start Lotus 1-2-3 and then use a feature of that spreadsheet program that shows you a list of worksheets and allows you to move the cursor to highlight the one you want to open. Cocoon will know only how many times you pressed the cursor key, not the name of the worksheet file that was highlighted.

If you add or delete another worksheet during that session, the order in which those names appears on your screen will change and if you subsequently use Cocoon to recover the session, it will open the wrong worksheet. Obviously, every keystroke it replays thereafter will damage a good worksheet and leave the one you wanted to repair untouched.

You can protect yourself by making sure that you always type file names when you are logging a session, instead of pointing with the cursor keys. But that may mean you have to change the way you are used to working with your favorite software.

Another problem arises if you work with an existing file during a logged session, as opposed to creating a new file. Under those circumstances, Cocoon will not be able to recreate the session accurately unless it can begin with a version of the existing file that is identical to the one you started working with.

Advertisement

That means you always should make backup copies of existing files when you begin a new logged session and then use the backup if you need to recover your keystrokes. Some programs give you the option of making backups when you open a file, and some even do it automatically. If your software does neither, you can use the COPY command of your operating system to make a backup before you start the session.

When working with backups, remember that they have a different name than your original file so you’ll have to change the name of the backup to that of the original before you can successfully recover the session.

Another thing to watch out for: Don’t make any intermediate saves of the file you are working on while you are logging keystrokes. If you do and you later need to recover, the file won’t be in the condition it was when you started the session. Not making intermediate saves will take some getting used to because it is contrary to every safety instruction you probably have learned. Of course, you do want to get into the habit of backing up your work either when you finish working on a file or before you begin working on it the next time.

In fact, as I wrote this column, my word processor automatically saved my text at intervals. That feature prevented Cocoon from working properly unless I used it with a backup version of the file.

The authors of Cocoon anticipated these kinds of problems and warn you about them in the instruction manual. But they also programmed a way to edit the log file during recovery so that you don’t execute unwanted keystrokes and ruin the very file that you are trying to save.

If you understand the pitfalls and watch out for them, Cocoon works very nicely. It is fun to watch it automatically recover the keystrokes because it is like having the computer on autopilot. The file is recreated at a brisk pace before your eyes. You also can set it for manual recovery in which you have to press a key (any key on the keyboard) to instruct Cocoon to recover the next keystroke in the log file. The manual mode is a little safer if you’re not sure if something will go haywire in the recovery process because it can be stopped at any point.

Advertisement

A very nice feature of Cocoon is that you can tell it to reconstruct your last session up to, but not including, the last keystroke you had typed. If it was the last keystroke that ruined things before, you certainly don’t want to repeat it during the recovery phase.

There are some other uses you can make of Cocoon. It can be used by programmers to debug a program by playing back keystrokes used to operate the program they are creating and show where they cause problems. The log file also can be used to create complex files for programs that allow the use of macros. A macro is a way to cause a single key to send a long series of keystrokes to the program.

Another use is to create program demonstrations that can be replayed for others to see.

In computing, things are seldom simple. Cocoon is a good example of a program works very well and performs a critically important task. But it has to be used with skill and care or you could end up with a worse mess than you started with.

Computer File welcomes readers’ comments but regrets that the author cannot respond individually to letters. Write to Richard O’Reilly, Computer File, Los Angeles Times, Times Mirror Square, Los Angeles, Calif. 90053.

THE SPECS: COCOON

Purpose: Cocoon is a memory-resident program that helps computer users recover files lost because of power failures or other computer breakdowns.

Requirements: IBM PC or compatible computer; hard disk; DOS 2.0 or greater.

Suggested retail price: $100.

Publisher: Daybreak Technologies Inc., 21311 Hawthorne Blvd., Suite 300, Torrance, Calif. 90503. (213) 542-5888.

Advertisement
Advertisement