;
                                 UNERASE.COM                                  

             Size (recs) CRC   Version    Author/Latest Issue      Disk
               2k (16)   825C  1.4        Gene Pizzetta 4/91       Z3COM6

  1- Syntax/Options  2- Configuration  3- Erasing Files  4- Notes             


   UNERASE is a ZCPR3 utility for  recovering  files that  have been erased in
error.  It will also list the  names of erased  files without recovering them.
Not for Z3PLUS.  Vs 1.0 (5/84) by Richard Conn.

:1
    Syntax   UNERASE {du:}afn{,afn{,afn{,...}}} {{/}options}

   Files are recovered on the given drive and to the given user (a DIR specif-
ication can be given).   If no DU is given,  the  current  defaults  are used.
Only the first drive/user specification is observed;  DU specs after first are
ignored (that is,  all following files are assumed to be on the same drive and
are recovered to the same user area).  As distributed, ambiguous filenames put
UNERASE into list-only mode:  matching erased files  are listed to the screen,
but no files are recovered.   To recover files  enter  a  list  of unambiguous
filenames.
 Options 

     L    List matching erased files only.  With this option no
          erased files are recovered, but all erased files that
          match the file specification will be listed to the
          screen.  As distributed, this mode is set automatically
          if an ambiguous filename is given.

     P    Don't page screen output.  In list-only mode the screen
          is paused each time it fills.  This option will toggle
          paging off, unless paging has been turned by the
          default, in which case the option will turn paging on.
          Paging does not work when files are been recovered
          because partially restored files may be left on the
          disk and may cause serious problems.  The number of
          screen lines is obtained from the environment.

     C    Pause first for disk change.  This option causes
          UNERASE to prompt for a new disk immediately after it
          is invoked (probably useful only if you have a single
          disk drive.  If the disk change pause is configured as
          the default mode, option C will toggle it off.
:2
 Configuration 

   Options P and C can be configured as the  defaults.   In addition,  UNERASE
can be configured to allow recovery of  ambiguous filenames,  if you insist on
that ability.  (You'll probably change it back the first time you forget the L
option and recover a bunch of files you don't want.)

   Configuration is accomplished with ZCNFG and the UNERASnn.CFG file.   It is
best not the change the name of the CFG file so that ZCNFG will always be able
to find it and so you won't use a CFG file for the wrong version of UNERASE.
:3
 Unerasing Files - 1/2 

   Successfully recovering a file is dependent on  several  factors,  the main
one being whether any writing has  been  done  to the  disk since the file was
erased.  If so, recovery is less likely.  Part of the file might be recovered,
but other blocks  allocated to the  file may contain data from a newly written
file.   That is pretty easy to determine with text  files,  but you won't know
about an executable file until you try to run it and it  crashes  your system.
Erasing such an improperly recovered file should  be immediately followed by a
disk reset.  Otherwise, your system will think the blocks are free even though
they're being used by another file.   Reseting  hard  disks  and  RAM disks on
ZRDOS or ZSDOS systems requires calling a  relogging program,  such as DISKRST
or RELOG.
 Unerasing Files - 2/2 

   If there are two or more erased  files with the  same  name,  UNERASE  will
recover all of them.   After the recovery only the first one  in the directory
will be accessible,  but the others will take up disk  space and you  won't be
able to erase one of them without erasing both or all of them.  There is hope, 
though, especially if the files are less than an extent in length (usually 16K
or 32K, depending on your system).   Try copying them to another disk using an
ambiguous filespec and using  a copy utility that prompts you before overwrit-
ing an existing file.   If the first copy of the  file is  the  one  you want,
answer  "No"  when the copy utility prompts for an  overwrite as  it  tries to
transfer the second copy of the file.  If the second copy is the one you want,
answer "Yes" to the  overwrite  prompt.   Once you have the  correct  copy  on
another disk,  you can safely erase the  copies  you  recovered  with UNERASE.
Then be sure to relog your disk.

  You're more likely to  avoid  problems  with  UNERASE if you regularly clean
your disk directories with CHKDIR and SAPZ.
:4
 UNERASE Notes - 1/4 

   a. Version 1.4 updates (4/4/91, Howard Goldstein):
      - Modified to skip the  initial  FRESET call if  the target drive can be
        determined to be a fixed disk.   This  eliminates the long  delay when
        the program starts up.  
      - User number is no longer displayed in List mode.  
      - The code has been cleaned up and reorganized in several places.

   b. Version 1.3 updates (3/26/91, Gene Pizzetta):
      - Did not properly relog hard drives or  RAM disks under ZRDOS or ZSDOS.
        Incorporated Bridger Mitchell's FRESET routine, to correctly relog 
        drives on all systems.  
      - Removed internal environment.  
      - Converted to Zilog mnemonics.  Option "Z" (recover files to user 0) 
        eliminated; now recovers files to default user, or to user given in DU
        spec.  
      - Screen now pages if more than  screenful of  matching erased files are
        found.
      - "Pause for  disk  change"  option  changed  to  "C";  "P" now controls
        paging.
 UNERASE Notes - 2/4 

      - Options "C" and "P" can be configured as defaults.  
      - Wildcard filenames now sets  "L" option  for  listing  names  of erase
        files; actual  unerasing  requires  unambiguous  filenames in the file
        list.   This method can be  changed to  allow unerasing wildcard file-
        names (kind of dangerous) by a configuration option.  
      - Configuration  by  ZCNFG.   (Paging  is  always  off  when  files  are 
        actually being recovered, for safety reasons.) 
      - Now aborts if not ZCPR3 or if CP/M-Plus.
      - Following bugs fixed:   (1) Disk change routine didn't work right (the
        disk parameters were being read before the routine  was  called),  (2)
        giving drive on command line  didn't  always  work,  (3) illegal drive
        spec detection never worked  (now works  for  ZCPR33  or higher),  (3)
        printed  filename  more than once  if file  extended for more than one
        data module  (S2),  (4) read  wrong  disk  parameter  block  if  drive
        allowed disks with more than one  format and disk wasn't last one read
        (now resets drive unconditionally before reading DPB, so we always get
        the correct DPB).
 UNERASE Notes - 3/4    

   c. Version 1.2 updates (9/25/85, Roger Warren):
      - Found and removed two more subtle nasties related to BIOS  calls:  (1)
        call to WRITE did not specify type, which could cause data to be lost; 
        (2) call to SELDSK did not set-up E register (new mount flag).

   d. Version 1.1 updates (9/20/85, Roger Warren):
      - Removed 2 MAJOR bugs:   (1) wrong disk may be selected;  (2) incorrect
        use of BIOS "SECTRAN".

   e. ZCPR2 predecessors:
       - Version 2.2 (7/25/83, Rick Conn):
         UNERA for ZCPR2.
       - Version 2.0 (7/23/83, Rick Conn):
         UNERA for ZCPR2.  Modified to be consistent in the ZCPR2 tool set.
 UNERASE Notes - 4/4 

   f. UNERA non-ZCPR predecessors:
       - Version 1.6 -- Dave Rand
       - Version 1.5 -- Irv Hoff
       - Version 1.4 -- Paul Traina
       - Version 1.3 -- Irv Hoff
       - Version 1.2 -- Charlie Strom
       - Version 1.1 -- Bruce Blakeslee
       - Version 1.0 -- Henry Rothberg
       - Retyped from Interface Age (Dec 81).
       Derivation:  UNERA,  "Program to Recover Erased Files"  by Gene Cotton,
       Interface Age, December 1981, page 146.
