home *** CD-ROM | disk | FTP | other *** search
AppleWorks Document | 1992-07-18 | 21.9 KB | 405 lines | [p???/pdos] |
- O=====<====<====<====<====<====<====<====<====<====<====<====<====<====<====<===
- O=====<====<====<====<====<====<====<====<====<====<====<====<====<====<====<===
- for postage and handling.versions) on a disk, send $10
- ============================================================
- RESURRECTION
- by Harold D. Portnoy
- Copyright 1990-92
- ============================================================
- 9 When an AppleWorks word processor or data base file ?
- =goes bad is not the time to worry about how you are going to
- repair the damage.?
- = CHANGE-A-FILE (CHGFIL.BXY) is a batch file utility that >
- <reads AppleWorks Word Processor (AWP) and text (TXT) files; ?
- =converts AWP files to TXT files, TXT files to AWP files, and >
- <AWP 3.0 files to AWP 2.x files; and rapidly repairs damaged
- AWP and ADB (data base) files.
- ------------------------------------------------------------
- While CHANGE-A-FILE can readily restore damaged =
- ;AppleWorks word processor (AWP) and data base (ADB) files, ?
- =it cannot restore a file on a disk with a damaged directory. 7
- 5RESURRECTION can restore these files .... most often 9
- 7rapidly, but occasionally with a little work. The disk ?
- =blocks containing the file that cannot be accessed are still ?
- =on the disk. The problem is where are the blocks and how can =
- ;they be placed in an accessible file. RESURRECTION answers =
- ;these two questions.
- RESURRECTION is not a substitute for 9
- 7Change-A-File. AWP and ADB files usually must first be =
- ;processed by Change-A-File's 'AWP File Doctor' or 'Restore >
- <ADB' in order to be accessed by AppleWorks.
- The text files =
- ;can be read with any appropriate utility such as 'View' in
- Change-A-File.
- RESURRECTION - -
- IMPORTANT! If you need this utility you are working ?
- =with a damaged disk. After rescuing all files posssible with 7
- 5Resurrection, the disk must be discarded if there is >
- <physical damage to the disk, or reformatted if you know the >
- <damage occurred electronically. Marking a bad block as used >
- <is only a stopgap measure. Failure to heed this warning may
- result in future problems.
- Activating protected utilities
- Transfer Change-A_File, Resurrection, and the Password =
- ;program to any directory. The Password program can be used ?
- =on all versions of Resurrection, but only on version 4.14 or =
- ;greater of Change-A-File. The Change-A-File program should ;
- 9be re-named CF.SYSTEM. Run either CF.system or Password. ?
- =Password can be used independent of Change-A-File and can be 9
- 7used to unlock Resurrection alone. Enter the password. 9
- 7Change-A-File will be unlocked and the password screen 7
- 5removed. This is indicated by the notice 'CF.SYSTEM >
- <unlocked'. Rename the file to CHANGE.FILE or any other name ?
- =of your choice. If you use CF.system to unlock Change-A-File ;
- 9the password screen will be removed whether you have the <
- :correct password or not. If you use the Password program, <
- :the screen is removed only if the password is correct. If ?
- =you enter the password, all the utilities will be able to be =
- ;used. If not, only the 'free' utilities will be able to be
- used. :
- If RESURRECTION is placed in the same directory as >
- <CF.SYSTEM, the Auto-Restore functions will also be unlocked <
- :on entering the password. This is indicated by the notice
- 'RESURRECTION unlocked'.
- Source Selection
- Insert the damaged disk (source) into a disk drive and <
- :then enter the slot and disk number or accept the default
- values.
- Diagnostics
- After selecting the slot and drive, you will be given >
- <the opportunity to select Diagnostics, and whether you wish ?
- =a complete analysis or only wish to determine bad blocks and 9
- 7mark the bad blocks as used in the volume bit map. The ?
- =volume bit map is a block(s) that contains information as to ?
- =whether any block on the disk is used or not. The volume bit 7
- 5map on 5.25 and 3.5 inch disks is on block 6. Larger :
- 8volumes, such as a hard disk, use additional contiguous =
- ;blocks for the volume bit map depending on the size of the
- volume.6
- 4 Determining the bad blocks on a disk is useful <
- :particularly before trying to access the disk. This gives =
- ;you advance notice of the problem, and marking a bad block =
- ;as used prevents ProDOS from using the bad block. If a bad :
- 8block is already marked as used, it will be noted. This >
- <means that the block has been used for a directory, file or =
- ;the volume bit map. If not marked, then this bad block was >
- <probably not responsible for failure to restore a file. You ?
- =will be asked whether you wish to mark the block as used. It >
- <is best to mark the block as used before running a complete =
- ;Diagnostics. Also noted is when a bad block is represented '
- in the volume bit map by a bad block.:
- Complete diagnostics gives you an over-view of the ?
- =damaged disk. Every block on the disk is analyzed unless you <
- :press any key to abort the process. A list of bad blocks, <
- :the volume bit map block(s), file index blocks, volume or :
- 8subdirectory blocks, and all text, AWP and ADB files is <
- :printed. With each subdirectory is given the previous and 5
- 3next blocks of the subdirectory. In a directory or ;
- 9subdirectory, subsequent subdirectories (DIR) are listed ;
- 9with their key blocks. Text (TXT), AWP and ADB files are =
- ;listed with their index blocks. With this information, you ?
- =can determine why you cannot access your file and decide the
- fastest method of restoration.;
- Diagnostics also searchs and identifies bad ADB and 8
- 6AWP files that have a special form of corrupted index ?
- =blocks. The file is marked as 'Bad index block(s)'. The bad 9
- 7file occurs when saving to a disk with only one or two 7
- 5blocks (1K) left. This type of file is automatically ?
- =corrected by the Auto-Restore by File Name function. If your 0
- disk is almost full, do not save to that disk.
- Let us first take a brief look at how ProDOS saves
- your file.>
- ____________________________________________________________
- ProDOS Directory and File Structure
- Volume Directory0
- _________________|_________________1
- | | | |3
- Subdirectory 1 File#
- ________|__________
- | |(
- File Subdirectory 2
- |*
- Your file index block.
- _____________|______________.
- | | | | | | | | | |)
- file data blocks
- ____________________________________________________________
- ProDOS divides a 5.25-inch disk into 280 blocks and a 6
- 43.5-inch disk into 1600 blocks. Some blocks contain ;
- 9directories, while others are file index blocks and file :
- 8data blocks (figure). Blocks 2-5 on every ProDOS volume 4
- 2contain the volume directory pointing to up to 51 ?
- =subdirectories or files. The subdirectories and files can be ;
- 9on any other block on the disk. The volume directory and ?
- =subdirectories contain the name and block addresses of other ?
- =subdirectories as well as files. The block address to a file :
- 8is really that of the index block of the file. The file :
- 8index block contains a list of pointers to all the data >
- <blocks in the file. The data blocks contain the actual file
- you want to restore.7
- Before using Diagnostics, turn on your printer. :
- 8Pass
- 1- Block analysis: prints out the block number (in <
- :hexadecimal notation) for every block with the following: ?
- =bad block, directory, subdirectory, text file, AWP file, and 9
- 7ADB file. Previous and next blocks and key blocks of a =
- ;directory or subdirectory are printed as well as the index >
- <blocks of the files. Pass 2- Index blocks unmatched to file ?
- =names: prints all the index blocks that are not matched to a <
- :file name of any type. Diagnostics thus provides you with ;
- 9the information necessary for determining how to restore =
- ;your file. Look for the file name of the file you want. If <
- :you can find the file name, then you can restore the file 0
- using the Auto-Restore by File Name function. :
- If you cannot find the file name, then a bad block >
- <probably contains the directory or subdirectory of the file ?
- =you want to restore. This will result in a list of unmatched ?
- =file index blocks in Pass 2. These are the index blocks that 8
- 6should be tried using the Auto-Restore by Index Block =
- ;function, since one of these index blocks probably belongs 7
- 5to the file in which you are interested. The list of =
- ;unmatched index blocks greatly reduces the number of index ?
- =blocks that have to be reviewed before finding the bad file. ;
- 9Even the additional blocks involved with tree and forked ?
- =files are matched. Only the first 4000 files are matched for <
- :index blocks. If you have over 4000 files on a hard disk, ?
- =the excess index blocks will be listed as unmatched. I don't #
- think this will happen too often.;
- It should be easy to find the index block of a file 8
- 6with a corrupted subdirectory. The index block of the :
- 8desired file will be in the unmatched list. Testing the >
- <listed blocks with the Auto-Restore by Index Block function <
- :should readily find the correct file. Other listed blocks >
- <will obviously not be correct. The only time there may be a :
- 8problem is when an index block belongs to a similar but 0
- deleted file in which the index block remains.=
- Note that large subdirectories can be pieced together :
- 8by using 'previous directory block' and 'next directory ?
- =block' numbers. Usually, the only time you will be forced to ;
- 9reconstruct the file by use of the time consuming Read / =
- Write function is when the index block for the file is bad.9
- Here is a tip. The most common block to go bad is :
- 8block 2, the block which contains the volume directory. :
- 8Therefore, besides keeping text, AWP and ADB files on a ?
- =separate disk, it is a good idea to use the volume directory =
- ;for subdirectories and files that can be readily replaced. <
- :This guarantees that the file name will not be in block 2 .
- and accessible to Auto-Restore by File Name.
- Destination Selection
- If you do not select Diagnostics, you will be ?
- =presented the destination selection. The complete file name, 2
- 0including the prefix, of the file to be created ;
- 9(destination) from the damaged file is then entered. The 7
- 5destination file cannot be on the disk in the source 9
- 7slot/drive. This prevents the new file from being on a <
- :damaged disk. Next the filetype is selected (TXT, AWP, or
- ADB).>
- When using the Read / Write functions, the destination ?
- =file does not have to be completed in one session. To append <
- :to a partially completed file, enter the destination file =
- ;name. At 'File already exists. Replace? (N/Y)', enter 'N'. :
- 8At 'Append ? (N/Y)', enter 'Y'. New blocks will then be (
- added to the end of the previous file.
- Function Selection
- The function screen is divided into an upper and lower >
- <half. The file name is printed in the left upper corner and 9
- 7the total blocks on the source disk in the right upper 8
- 6corner. The number of blocks on the disk is initially >
- <determined from the volume directory on block 2. If block 2 ?
- =is damaged, then an attempt is made to determine volume size <
- :by two other methods. If all methods fail, then a 'VOLUME ?
- =BLOCKS $' window will open. Enter the volume size in blocks. =
- ;This should be rarely necessary. The following can be used ?
- =to determine the number of blocks. A 5.25 inch disk has $118 <
- :blocks (140 blocks); a 3.5 inch disk, $640 (1600 blocks); ,
- and hard discs, $800 * size in megabytes. ;
- The functions are printed on the bottom line of the =
- ;screen. The following can be selected: Arrows, Quit, Read,
- Write, Dump.
- Read: Blocks from the damaged disks are accessed <
- :either by the up and down arrows, which select the blocks :
- 8sequentially, or by entering 'R'. A window appears with ?
- ='Read Block $'. Enter the desired block number. The block is >
- <displayed in the lower half of the screen. The block number ?
- =is displayed in the left margin at 'Read Block'. For ease of =
- ;review, only the characters in the range of $20 - $7F (the 8
- 6text characters) are printed to the screen. All other (
- characters are replaced with a period.
- Write: Enter 'W' to write the block to the new file. ?
- =The block is displayed on the upper half of the screen. Only <
- :a previously read block can be written to file. The block :
- number is displayed in the left margin at 'Write Block'.9
- The next block in the file can be accessed by the >
- <arrows or 'R' and the process repeated until all the blocks ;
- 9in the old file are transferred to the destination file. >
- <Once a block in the source file is found, succeeding blocks ?
- =are frequently found in sequential order and easily accessed
- by the up arrow.
- Dump: Any block that has been read can be dumped to >
- <the printer by entering 'D'. The easiest way to reconstruct ?
- =a file is to first dump all the blocks, which are identified =
- ;with a block number, to a printer. Determine the order of >
- <the blocks. Reenter the program and write the blocks to the '
- destination file in the proper order.9
- The printer output is set to slot 1. If you use a >
- <different slot, then change the low nibble of byte $03 (C1) ?
- =to the slot number. This is most easily accomplished using a 5
- 3block editing utility such as ProSel Block Warden. =
- ;Alternately the following patch will suffice after setting 6
- the prefix to the directory containing RESURRECTION.
- POKE 768,19n (where n = slot number + 2)/
-
- BSAVE RESURRECTION,TSYS,A$300,L1,B3
- Auto-Restore: There are two Auto-Restore functions: by =
- ;File Name and by Index Block. Auto-Restore by File Name is ;
- 9the best method to restore a file. It requires, however, ;
- 9that a parent directory be intact. Auto-Restore by Index :
- 8Block only requires that the index block of the file be ?
- =intact. It is less efficient than restoring by file name and :
- 8should be used only after Auto-Restore by File Name has ?
- =failed. It is much more efficient than reconstructing a file ;
- 9using the Read/Write functions. Entering 'A' brings up a <
- :menu for selecting either Auto-Restore by file name or by
- index block.
- Auto-Restore by File Name will restore a file as long 8
- 6as the parent directory or subdirectory and the index >
- <block(s) of the file are intact. If the volume directory is 9
- 7damaged or any of the other directories up to, but not <
- :including, the parent subdirectory, the file can still be <
- :recovered. A common cause for failure to access a file is >
- <damage to the volume directory in block 2. If the directory <
- :file entry of the file is not in block 2, the file can be
- recovered.<
- On selecting by file name, the 'Find File' window is =
- ;opened. Enter the file name only. Do NOT enter any prefix. 9
- 7The file type must be the same as previously selected. :
- 8Auto-Restore will search the damaged disk for the file. 9
- 7Pressing any key will abort the search. If the file is ?
- =found, identifying attributes are displayed in a window. The >
- <attributes are parent directory or subdirectory, file type, =
- ;size in blocks, and modification date and time. If this is <
- :the correct file enter 'Y' at 'Accept (N/Y)'. If not, you 7
- 5will be given the option of continuing the search or
- aborting. =
- When the file is accepted, Auto-Restore automatically ;
- 9reconstructs the damaged file under the destination file ?
- =name. DO NOT INTERRUPT the reconstruction. When complete the $
- program returns to the input menu.<
- Use Auto-Restore by File Name to restore a file with
- bad index blocks (see above).
- Auto-Restore by Index Block cannot find a seedling ?
- =file (only one block) nor directly handle files in excess of ?
- =256 blocks. It is ideal for sapling files, that is, files of ;
- 92 - 256 blocks. Most files fall into this category. Tree 9
- 7files ( > 256 blocks) must be reconstructed from file ?
- =segments of 256 blocks. The algorithm used should detect all =
- ;index blocks. It may, however, recognize a non-index block
- as an index block. <
- Selecting Auto-Restore by Index Block presents a new ;
- 9function screen: Select Arrows (up and down), Accept and 9
- 7Next index block; and an 'Index Block $' window. Enter ;
- 9RETURN when searching for a file for the first time. The 9
- 7search will start with block 7. If you have an idea of <
- :approximately where the file is on the disk, then enter a =
- ;block number that is known to be before the index block of ;
- 9the file for which you are looking and press RETURN. The <
- :disk will be searched for an index block. When found, the 8
- 6first two blocks of the file will be displayed on the =
- ;screen. If you need more information in order to decide if =
- ;you have the correct file then select the up arrow and two ?
- =more blocks will be presented until the file ends. Selecting <
- :the down arrow, backs up two blocks. The block numbers on >
- <the right can be quite useful. If the block numbers are not ?
- =sequential, it is less likely that the indicated block is an <
- index block. Press 'N' to search for the next index block.=
- When you are satisfied that the correct file has been ?
- =found, select 'A' and the file will be reconstructed. In the 7
- 5search, a 'Bad Block' window may be displayed, which :
- 8indicates a bad block has been encountered. Continue by )
- selecting 'N' for the next index block.>
- With a little time and effort, tree files can be first >
- <reconstructed into multiple files of 256 blocks. AppleWorks >
- <can then be used to append one file to the next in order to ?
- =reconstruct the original tree file. Not the best, but better
- than block by block.
- Quit: Enter 'Q' to complete the destination file.
- ESC: Entering ESC at any point in the program resets <
- :to the initial screen. At the initial 'Slot' request, ESC 7
- quits the program. The destination file is not saved.
- Icons
- : CF.RES.ICONS contains Change-A-File and Resurrection ?
- =icons. The Change-A-File icon is courtesy of Karl Bunker. To ;
- 9use these icons in the Finder, place CF.RES.ICONS in the (
- &ICONS subdirectory of the boot volume 8
- 6(BOOT.VOLUME/ICONS/CF.RES.ICONS) and reboot. The two 3
- 1programs must have file names of CHANGE.FILE and
- RESURRECTION.
- -------------------------------------------------------
- IMPORTANT NOTICE
- Auto-Restore is not accessible unless you have the ;
- 9CHANGE-A-FILE password. If RESURRECTION is placed in the >
- <same directory as CF.SYSTEM, the Auto-Restore function will 9
- 7be unlocked on entering the password and then quitting
- CHANGE.FILE.>
- Transfer the CHANGE.FILE and RESURRECTION files to the 7
- 5volume directory of a disk under ProDOS (P8). Rename ;
- 9CHANGE.FILE to CF.SYSTEM. Be sure this file is the first >
- <.SYSTEM file in the directory (e.g. ahead of BASIC.SYSTEM). >
- <Boot the disk. (You must boot directly into CF.SYSTEM.) The >
- <password screen will be presented. Enter the password. When :
- 8the menu is presented, select Quit. CHANGE.FILE will be =
- ;rewritten to the disk without the screen. The Auto-Restore ?
- =function of RESURRECTION will be activated. Rename CF.SYSTEM ?
- =to CHANGE.FILE or any other name of your choice. Whether you 8
- 6have the password or not, the password screen will be =
- ;removed. If you enter the password, all the utilities will ?
- =be able to be used in both programs. If not, only the 'free' %
- utilities will be able to be used.
- The CHANGE-A-FILE password can be obtained for $10.00
- from:
- Change.File!
- c/o Harold D. Portnoy
- 1431 Woodward&
- Bloomfield Hills, MI 48013
- 6 To obtain unlocked versions of Change-A-File and ;
- 9Resurrection and the password (for future versions) on a 8
- disk, send $10.00 plus $4.00 for postage and handling.
- ------------------------------------------------------------
- All rights reserved.
- AppleWorks, copyright Claris Corporation
- ProSel, copyright Glen Bredon
- Suggestions, bugs and other trivia to:
- Harold D. Portnoy
- Compuserve [75156,2436]
- GEnie [H.PORTNOY]
- Versions:
- 1.0- First attempt.0
- 1.1- Improved layout and docs. Adds scan.
- 1.2- Adds Auto-Restore.4
- 1.3- Improved Auto-Restore. Also removes bug.3
- 1.4- A few bug fixes and minor improvements.;
- 1.5- Improved determination of volume size and a bug
- fix.-
- 1.6- Adds Auto-Restore by Index Block.0
- 1.7- Improved algorithm for Auto-Restore.8
- 1.8- Improved algorithm for finding index blocks 1
- (because of comments from J. Wisnia).<
- 1.9- Much better algorithm for finding index blocks. :
- Similar to that in ProSel Block Warden. Thanks'
- to G. Bredon for his input.%
- 2.0- Add Diagnostics.
- 2.1- Much improved and simplified Diagnostics.>
- 2.2- Diagnostics further improved to reduce number of
- unmatched files that need to be tested.>
- 2.3- Diagnostics bug fix. Complete Diagnostics or only
- bad blocks.>
- < 2.4- Further improvements in Diagnostics particularly
- useful for large volumes.6
- 2.6- Mark bad blocks as used in volume bit map.=
- 2.7- Diagnostics improved to include detection of bad &
- index blocks in ADB files.1
- 2.8- Fix bug in Auto-Restore by File Name.;
- 2.9- Diagnostics now detect bad index blocks in ABD =
- and AWP files. If file has bad index block, Auto-3
- Restore by file name will restore file.
-