home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ENTERPRS
/
CPM
/
UTILS
/
S
/
UNDELETE.LBR
/
UNDELETE.DZC
/
UNDELETE.DOC
Wrap
Text File
|
2000-06-30
|
5KB
|
105 lines
UNDELETE.COM
A SMART FILE UNDELETE UTILITY
By Guy Cousineau
1989-08-27
UNERA.COM was a welcome addition to the CP/M public domain and was very useful
in recovering accidentally deleted files. It had, however, a few drawbacks in
that it allowed unerasing files which would duplicate entries already in the
current DU and unerased files which overlapped the same allocation blocks as
other active files.
Hence the creation of UNDELETE.COM. This utility works in the following
fashion:
1 find all deleted files
2 mask out files with no EXTENT 0 (incomplete)
3 mask out files with allocation overlaps
4 mask out files with the same name as active files (slow part)
5 prompt for tagging of files to recover
6 undelete the tagged files
SYNTAX: UNDELETE [d:]
DETAILED EXPLANATIONS
1
If no drive is specified the current drive is used. The program LOGS IN the
selected drive and finds the directory size. Each directory record is read and
scanned for deleted files, building table entries in RAM for each found file.
2
Print first report skipping all entries corresponding to further extents of a
file. This fashion of reporting effectively masks out large files for which
extent 0 has been overwritten but other extents still exist in the directory.
3
The table is re-scanned and each allocation block checked against a copy of the
allocation vector. If there is overlap, the file flag is set to disable
recovery. If the allocation is unused, it is set to used to prevent recovery
of other files which may use the same allocation. A second report is then
printed.
4
Check the current drive/user for matches of the deleted files remaining in the
table. These files may be undeleted later if the corresponding active file is
renamed. A third report is then printed showing only the files which are safe
to undelete.
5
Print the files out one by one and ask the user to tag them with a 'u' or a
'U' for UNDELETE. After the files are tagged, the user is asked for
confirmation: a 'u' proceeds and a CONTROL-C aborts.
At every stage of the analysis, a printout is given of the FILES FOUND SO FAR.
This way, you can see those files you want to recover but might be unable to
because of internal conflicts. If at any time, the number of recoverable files
becomes 0, the program aborts. To manually abort the undelete process, press
CONTROL-C at any prompt.
USE CONSIDERATION
Although this utility is smarter than UNERA.COM it can fail if a file with
more than one directory entry is missing its second entry. Under normal
directory operations, this is an impossible situation since directory entries
are filled in from the start of the directory. Thus if extent 1 is missing
then extent 0 must be missing as well.
The ALLOCATION overlap can also fail if a sort-and-pack program was used to
re-order the directory entries. Under normal operations, it is impossible for
the second of 2 deleted files (using the same allocation blocks) to be the
UNDELETEABLE one. With SAP, there is no way of accurately determining which
file can be undeleted.
If there are 2 copies of the same deleted file, they will show up as 2 entries
in the TAG menu. To recover both and check which is the most current, start
by tagging only one version and rename it to another UNUSED name. Run
UNDELETE again and tag the second version. Check them both out and delete the
one you don't want to keep.
Although UNDELETE is smarter than UNERA, you should verify all recovered files
before using. Particularly in the case of .COM files, it is wise to tread
safely with back-up disks when testing the recovered file.
Since UNDELETE recovers files to the current user area, you should select the
user number which is appropriate to the recovery attempt. Hey, you can even
use UNDELETE to move a file from one user to the next by deleteing it from one
area, logging into another user, and undeleteing it.
The utility has been tested on a CP/M 2.2 system and should behave correctly
on any Z-80 CP/M 2.x. It has been tested with 1,2, and 4 K allocation blocks
on media with 1 and 2 byte allocations. Although it has performed with no
problems on these media, it is not guaranteed to work in non-standard
environments. Since I have not been able to test it on CP/M 3.x or CP/M plus,
the operation on those systems has been disabled. The utility will only run on
a BDOS which reports a "2?" HEX when asked for version. See the notes near the
end of the first page to disable check for CP/M 2.x
Use the program in good health, please send bug reports to:
Guy Cousineau
1059 Hindley Street
OTTAWA Canada
K2B 5L9