UNERA33.DOC November 20, 1988 Notes by Irv Hoff, culled from earlier comments by others RECOVERING ERASED CP/M FILES ---------------------------- UNERA, an utility program written by Gene Cotton, first appeared in INTERFACE AGE for December 1981 (p. 96). When a file is erased, a hexadecimal "E5" is placed at the start of that filename (the user-number byte) in the disk directory area. This releases the blocks allocated to that file for future use by the BDOS. If you should ever realize that you have inadvertently erased the wrong file, you can recover it immediately by using this program. Usage: A>UNERA FILENAME.EXT (name of recently erased file) Since the BDOS usually proceeds sequentially through the blocks re- maining on a disk during file allocation you can often recover an erased file even after some additional disk activity, particularly on a par- tially used disk. Normally, by that time you would have forgotten the name of the file you wanted to recover, anyway. If you do recover a file immediately, it should be back to its nor- mal state. If things have been added to the disk since you erased the file, it may be recovered intact, or sections of it may have been over- written. In that case, examine it carefully, and with luck it will turn out to be normal. In any case, portions of it can likely be recovered. If a file has been edited several times, each new edit often uses different areas of the disk. Recovery of such a file, even though done immediately, sometimes adds those previously used areas to the file just erased. Even though the resulting file is then longer than expected, you can usually edit out the surplus. UNERA supports "wildcards" such as "?" or "*". It automatically adjusts for the current CP/M 2.2 or for older CP/M 1.4. A description of the command format follows: A>UNERA [d:]filename.typ [p] where d: is the drive where the erased file is located (optional) filename.typ is the filename and type of the file that has been erased; wildcards are permitted p allows a change of diskettes and prompts for hitting a to continue (useful on one- drive systems) This should reclaim to the current user area D:FILENAME.TYP that you erased in error or otherwise wanted to recover. COMMENTS: --------- Using ERAQ.COM or KILL.COM to erase files rather than the CCP's built-in ERA command will minimize accidentally erasing incorrect files. Those programs show the name(s) of the file(s) to be erased and then ask you to verify the operation on each file. (They also work with wild- cards.) Files may also be recovered by using such programs as DU, DUU, DUUP, DUV8x, etc. These are very powerful multipurpose utilities for disk handling; they require some talent to use and do not compare with UNERA in simplicity. If you erase a file from within any user area and then run UNERA, it will always restore the file to the current user area. This can even serve as a "quick and dirty" method of moving files between user areas. UNERA is written to run on an 8080, 8085, or Z80 microprocessor and to be assembled with ASM.COM, the assembler that comes with CP/M. The program uses direct BIOS calls, to read and write back the directory. - Irv Hoff