home *** CD-ROM | disk | FTP | other *** search
/ LOGIC 2000 February / LogicCd--feb.2000-mac-cdr.iso / Apple II / CHANGEAFILE / RESUR.DOC (.txt) < prev    next >
Encoding:
AppleWorks Document  |  1992-07-18  |  21.9 KB  |  405 lines  |  [p???/pdos]

  1. O=====<====<====<====<====<====<====<====<====<====<====<====<====<====<====<===
  2. O=====<====<====<====<====<====<====<====<====<====<====<====<====<====<====<===
  3. for postage and handling.versions) on a disk, send $10
  4. ============================================================
  5.  RESURRECTION
  6.  by Harold D. Portnoy
  7.  Copyright 1990-92
  8. ============================================================
  9. 9     When an AppleWorks word processor or data base file ?
  10. =goes bad is not the time to worry about how you are going to 
  11. repair the damage.?
  12. =     CHANGE-A-FILE (CHGFIL.BXY) is a batch file utility that >
  13. <reads AppleWorks Word Processor (AWP) and text (TXT) files; ?
  14. =converts AWP files to TXT files, TXT files to AWP files, and >
  15. <AWP 3.0 files to AWP 2.x files; and rapidly repairs damaged  
  16. AWP and ADB (data base) files.
  17. ------------------------------------------------------------
  18. While CHANGE-A-FILE can readily restore damaged =
  19. ;AppleWorks word processor (AWP) and data base (ADB) files, ?
  20. =it cannot restore a file on a disk with a damaged directory. 7
  21. 5RESURRECTION can restore these files .... most often 9
  22. 7rapidly, but occasionally with a little work. The disk ?
  23. =blocks containing the file that cannot be accessed are still ?
  24. =on the disk. The problem is where are the blocks and how can =
  25. ;they be placed in an accessible file. RESURRECTION answers =
  26. ;these two questions. 
  27. RESURRECTION is not a substitute for 9
  28. 7Change-A-File. AWP and ADB files usually must first be =
  29. ;processed by Change-A-File's 'AWP File Doctor' or 'Restore >
  30. <ADB' in order to be accessed by AppleWorks.
  31.  The text files =
  32. ;can be read with any appropriate utility such as 'View' in 
  33. Change-A-File. 
  34. RESURRECTION                                        -      -
  35. IMPORTANT! If you need this utility you are working ?
  36. =with a damaged disk. After rescuing all files posssible with 7
  37. 5Resurrection, the disk must be discarded if there is >
  38. <physical damage to the disk, or reformatted if you know the >
  39. <damage occurred electronically. Marking a bad block as used >
  40. <is only a stopgap measure. Failure to heed this warning may 
  41. result in future problems.
  42. Activating protected utilities
  43. Transfer Change-A_File, Resurrection, and the Password =
  44. ;program to any directory. The Password program can be used ?
  45. =on all versions of Resurrection, but only on version 4.14 or =
  46. ;greater of Change-A-File. The Change-A-File program should ;
  47. 9be re-named CF.SYSTEM. Run either CF.system or Password. ?
  48. =Password can be used independent of Change-A-File and can be 9
  49. 7used to unlock Resurrection alone. Enter the password. 9
  50. 7Change-A-File will be unlocked and the password screen 7
  51. 5removed. This is indicated by the notice 'CF.SYSTEM  >
  52. <unlocked'. Rename the file to CHANGE.FILE or any other name ?
  53. =of your choice. If you use CF.system to unlock Change-A-File ;
  54. 9the password screen will be removed whether you have the <
  55. :correct password or not. If you use the Password program, <
  56. :the screen is removed only if the password is correct. If ?
  57. =you enter the password, all the utilities will be able to be =
  58. ;used. If not, only the 'free' utilities will be able to be 
  59. used. :
  60. If RESURRECTION is placed in the same directory as >
  61. <CF.SYSTEM, the Auto-Restore functions will also be unlocked <
  62. :on entering the password. This is indicated by the notice 
  63. 'RESURRECTION  unlocked'. 
  64. Source Selection
  65. Insert the damaged disk (source) into a disk drive and <
  66. :then enter the slot and disk number or accept the default     
  67. values.
  68. Diagnostics
  69. After selecting the slot and drive, you will be given >
  70. <the opportunity to select Diagnostics, and whether you wish ?
  71. =a complete analysis or only wish to determine bad blocks and 9
  72. 7mark the bad blocks as used in the volume bit map. The ?
  73. =volume bit map is a block(s) that contains information as to ?
  74. =whether any block on the disk is used or not. The volume bit 7
  75. 5map on 5.25 and 3.5 inch disks is on block 6. Larger :
  76. 8volumes, such as a hard disk, use additional contiguous =
  77. ;blocks for the volume bit map depending on the size of the     
  78. volume.6
  79. 4     Determining the bad blocks on a disk is useful <
  80. :particularly before trying to access the disk. This gives =
  81. ;you advance notice of the problem, and marking a bad block =
  82. ;as used prevents ProDOS from using the bad block. If a bad :
  83. 8block is already marked as used, it will be noted. This >
  84. <means that the block has been used for a directory, file or =
  85. ;the volume bit map. If not marked, then this bad block was >
  86. <probably not responsible for failure to restore a file. You ?
  87. =will be asked whether you wish to mark the block as used. It >
  88. <is best to mark the block as used before running a complete =
  89. ;Diagnostics. Also noted is when a bad block is represented '
  90. in the volume bit map by a bad block.:
  91. Complete diagnostics gives you an over-view of the ?
  92. =damaged disk. Every block on the disk is analyzed unless you <
  93. :press any key to abort the process. A list of bad blocks, <
  94. :the volume bit map block(s), file index blocks, volume or :
  95. 8subdirectory blocks, and all text, AWP and ADB files is <
  96. :printed. With each subdirectory is given the previous and 5
  97. 3next blocks of the subdirectory. In a directory or ;
  98. 9subdirectory, subsequent subdirectories (DIR) are listed ;
  99. 9with their key blocks. Text (TXT), AWP and ADB files are =
  100. ;listed with their index blocks. With this information, you ?
  101. =can determine why you cannot access your file and decide the  
  102. fastest method of restoration.;
  103. Diagnostics also searchs and identifies bad ADB and 8
  104. 6AWP files that have a special form of corrupted index ?
  105. =blocks. The file is marked as 'Bad index block(s)'. The bad  9
  106. 7file occurs when saving to a disk with only one or two 7
  107. 5blocks (1K) left. This type of file is automatically ?
  108. =corrected by the Auto-Restore by File Name function. If your 0
  109. disk is almost full, do not save to that disk.
  110. Let us first take a brief look at how ProDOS saves 
  111. your file.>
  112. ____________________________________________________________
  113. ProDOS Directory and File Structure
  114.                      Volume Directory0
  115.            _________________|_________________1
  116.            |          |            |          |3
  117.                  Subdirectory 1              File#
  118.               ________|__________ 
  119.                  |           |(
  120.                 File    Subdirectory 2 
  121.                              |*
  122.                    Your file index block.
  123.                 _____________|______________.
  124.                 |  |  |  |  |  |  |  |  |  |)
  125.                       file data blocks 
  126. ____________________________________________________________
  127. ProDOS divides a 5.25-inch disk into 280 blocks and a 6
  128. 43.5-inch disk into 1600 blocks. Some blocks contain ;
  129. 9directories, while others are file index blocks and file :
  130. 8data blocks (figure). Blocks 2-5 on every ProDOS volume 4
  131. 2contain the volume directory pointing to up to 51 ?
  132. =subdirectories or files. The subdirectories and files can be ;
  133. 9on any other block on the disk. The volume directory and ?
  134. =subdirectories contain the name and block addresses of other ?
  135. =subdirectories as well as files. The block address to a file :
  136. 8is really that of the index block of the file. The file :
  137. 8index block contains a list of pointers to all the data >
  138. <blocks in the file. The data blocks contain the actual file 
  139. you want to restore.7
  140. Before using Diagnostics, turn on your printer. :
  141. 8Pass
  142. 1- Block analysis: prints out the block number (in <
  143. :hexadecimal notation) for every block with the following: ?
  144. =bad block, directory, subdirectory, text file, AWP file, and 9
  145. 7ADB file. Previous and next blocks and key blocks of a =
  146. ;directory or subdirectory are printed as well as the index >
  147. <blocks of the files. Pass 2- Index blocks unmatched to file ?
  148. =names: prints all the index blocks that are not matched to a <
  149. :file name of any type. Diagnostics thus provides you with ;
  150. 9the information necessary for determining how to restore =
  151. ;your file. Look for the file name of the file you want. If <
  152. :you can find the file name, then you can restore the file 0
  153. using the Auto-Restore by File Name function. :
  154. If you cannot find the file name, then a bad block >
  155. <probably contains the directory or subdirectory of the file ?
  156. =you want to restore. This will result in a list of unmatched ?
  157. =file index blocks in Pass 2. These are the index blocks that 8
  158. 6should be tried using the Auto-Restore by Index Block =
  159. ;function, since one of these index blocks probably belongs 7
  160. 5to the file in which you are interested. The list of =
  161. ;unmatched index blocks greatly reduces the number of index ?
  162. =blocks that have to be reviewed before finding the bad file. ;
  163. 9Even the additional blocks involved with tree and forked ?
  164. =files are matched. Only the first 4000 files are matched for <
  165. :index blocks. If you have over 4000 files on a hard disk, ?
  166. =the excess index blocks will be listed as unmatched. I don't #
  167. think this will happen too often.;
  168. It should be easy to find the index block of a file 8
  169. 6with a corrupted subdirectory. The index block of the :
  170. 8desired file will be in the unmatched list. Testing the >
  171. <listed blocks with the Auto-Restore by Index Block function <
  172. :should readily find the correct file. Other listed blocks >
  173. <will obviously not be correct. The only time there may be a :
  174. 8problem is when an index block belongs to a similar but 0
  175. deleted file in which the index block remains.=
  176. Note that large subdirectories can be pieced together :
  177. 8by using 'previous directory block' and 'next directory ?
  178. =block' numbers. Usually, the only time you will be forced to ;
  179. 9reconstruct the file by use of the time consuming Read / =
  180. Write function is when the index block for the file is bad.9
  181. Here is a tip. The most common block to go bad is :
  182. 8block 2, the block which contains the volume directory. :
  183. 8Therefore, besides keeping text, AWP and ADB files on a ?
  184. =separate disk, it is a good idea to use the volume directory =
  185. ;for subdirectories and files that can be readily replaced. <
  186. :This guarantees that the file name will not be in block 2 .
  187. and accessible to Auto-Restore by File Name.
  188. Destination Selection
  189. If you do not select Diagnostics, you will be ?
  190. =presented the destination selection. The complete file name, 2
  191. 0including the prefix, of the file to be created ;
  192. 9(destination) from the damaged file is then entered. The 7
  193. 5destination file cannot be on the disk in the source 9
  194. 7slot/drive. This prevents the new file from being on a <
  195. :damaged disk. Next the filetype is selected (TXT, AWP, or 
  196. ADB).>
  197. When using the Read / Write functions, the destination ?
  198. =file does not have to be completed in one session. To append <
  199. :to a partially completed file, enter the destination file =
  200. ;name. At 'File already exists. Replace? (N/Y)', enter 'N'. :
  201. 8At 'Append ? (N/Y)', enter 'Y'. New blocks will then be (
  202. added to the end of the previous file.
  203. Function Selection
  204. The function screen is divided into an upper and lower >
  205. <half. The file name is printed in the left upper corner and 9
  206. 7the total blocks on the source disk in the right upper 8
  207. 6corner. The number of blocks on the disk is initially >
  208. <determined from the volume directory on block 2. If block 2 ?
  209. =is damaged, then an attempt is made to determine volume size <
  210. :by two other methods. If all methods fail, then a 'VOLUME ?
  211. =BLOCKS $' window will open. Enter the volume size in blocks. =
  212. ;This should be rarely necessary. The following can be used ?
  213. =to determine the number of blocks. A 5.25 inch disk has $118 <
  214. :blocks (140 blocks); a 3.5 inch disk, $640 (1600 blocks); ,
  215. and hard discs, $800 * size in megabytes. ;
  216. The functions are printed on the bottom line of the =
  217. ;screen. The following can be selected: Arrows, Quit, Read, 
  218. Write, Dump.
  219. Read: Blocks from the damaged disks are accessed <
  220. :either by the up and down arrows, which select the blocks :
  221. 8sequentially, or by entering 'R'. A window appears with ?
  222. ='Read Block $'. Enter the desired block number. The block is >
  223. <displayed in the lower half of the screen. The block number ?
  224. =is displayed in the left margin at 'Read Block'. For ease of =
  225. ;review, only the characters in the range of $20 - $7F (the 8
  226. 6text characters) are printed to the screen. All other (
  227. characters are replaced with a period.
  228. Write: Enter 'W' to write the block to the new file. ?
  229. =The block is displayed on the upper half of the screen. Only <
  230. :a previously read block can be written to file. The block :
  231. number is displayed in the left margin at 'Write Block'.9
  232. The next block in the file can be accessed by the >
  233. <arrows or 'R' and the process repeated until all the blocks ;
  234. 9in the old file are transferred to the destination file. >
  235. <Once a block in the source file is found, succeeding blocks ?
  236. =are frequently found in sequential order and easily accessed 
  237. by the up arrow. 
  238. Dump: Any block that has been read can be dumped to >
  239. <the printer by entering 'D'. The easiest way to reconstruct ?
  240. =a file is to first dump all the blocks, which are identified =
  241. ;with a block number,  to a printer. Determine the order of >
  242. <the blocks. Reenter the program and write the blocks to the '
  243. destination file in the proper order.9
  244. The printer output is set to slot 1. If you use a >
  245. <different slot, then change the low nibble of byte $03 (C1) ?
  246. =to the slot number. This is most easily accomplished using a 5
  247. 3block editing utility such as ProSel Block Warden. =
  248. ;Alternately the following patch will suffice after setting 6
  249. the prefix to the directory containing RESURRECTION.
  250. POKE 768,19n  (where n = slot number + 2)/
  251.      
  252. BSAVE RESURRECTION,TSYS,A$300,L1,B3
  253. Auto-Restore: There are two Auto-Restore functions: by =
  254. ;File Name and by Index Block. Auto-Restore by File Name is ;
  255. 9the best method to restore a file. It requires, however, ;
  256. 9that a parent directory be intact. Auto-Restore by Index :
  257. 8Block only requires that the index block of the file be ?
  258. =intact. It is less efficient than restoring by file name and :
  259. 8should be used only after Auto-Restore by File Name has ?
  260. =failed. It is much more efficient than reconstructing a file ;
  261. 9using the Read/Write functions. Entering 'A' brings up a <
  262. :menu for selecting either Auto-Restore by file name or by 
  263. index block.
  264. Auto-Restore by File Name will restore a file as long 8
  265. 6as the parent directory or subdirectory and the index >
  266. <block(s) of the file are intact. If the volume directory is 9
  267. 7damaged or any of the other directories up to, but not <
  268. :including, the parent subdirectory, the file can still be <
  269. :recovered. A common cause for failure to access a file is >
  270. <damage to the volume directory in block 2. If the directory <
  271. :file entry of the file is not in block 2, the file can be 
  272. recovered.<
  273. On selecting by file name, the 'Find File' window is =
  274. ;opened. Enter the file name only. Do NOT enter any prefix. 9
  275. 7The file type must be the same as previously selected. :
  276. 8Auto-Restore will search the damaged disk for the file. 9
  277. 7Pressing any key will abort the search. If the file is ?
  278. =found, identifying attributes are displayed in a window. The >
  279. <attributes are parent directory or subdirectory, file type, =
  280. ;size in blocks, and modification date and time. If this is <
  281. :the correct file enter 'Y' at 'Accept (N/Y)'. If not, you 7
  282. 5will be given the option of continuing the search or 
  283. aborting. =
  284. When the file is accepted, Auto-Restore automatically ;
  285. 9reconstructs the damaged file under the destination file ?
  286. =name. DO NOT INTERRUPT the reconstruction. When complete the $
  287. program returns to the input menu.<
  288. Use Auto-Restore by File Name to restore a file with 
  289. bad index blocks (see above).
  290. Auto-Restore by Index Block cannot find a seedling ?
  291. =file (only one block) nor directly handle files in excess of ?
  292. =256 blocks. It is ideal for sapling files, that is, files of ;
  293. 92 - 256 blocks. Most files fall into this category. Tree 9
  294. 7files ( > 256 blocks)  must be reconstructed from file ?
  295. =segments of 256 blocks. The algorithm used should detect all =
  296. ;index blocks. It may, however, recognize a non-index block 
  297. as an index block. <
  298. Selecting Auto-Restore by Index Block presents a new ;
  299. 9function screen: Select Arrows (up and down), Accept and 9
  300. 7Next index block; and an 'Index Block $' window. Enter ;
  301. 9RETURN when searching for a file for the first time. The 9
  302. 7search will start with block 7. If you have an idea of <
  303. :approximately where the file is on the disk, then enter a =
  304. ;block number that is known to be before the index block of ;
  305. 9the file for which you are looking and press RETURN. The <
  306. :disk will be searched for an index block. When found, the 8
  307. 6first two blocks of the file will be displayed on the =
  308. ;screen. If you need more information in order to decide if =
  309. ;you have the correct file then select the up arrow and two ?
  310. =more blocks will be presented until the file ends. Selecting <
  311. :the down arrow, backs up two blocks. The block numbers on >
  312. <the right can be quite useful. If the block numbers are not ?
  313. =sequential, it is less likely that the indicated block is an <
  314. index block. Press 'N' to search for the next index block.=
  315. When you are satisfied that the correct file has been ?
  316. =found, select 'A' and the file will be reconstructed. In the 7
  317. 5search, a 'Bad Block' window may be displayed, which :
  318. 8indicates a bad block has been encountered. Continue by )
  319. selecting 'N' for the next index block.>
  320. With a little time and effort, tree files can be first >
  321. <reconstructed into multiple files of 256 blocks. AppleWorks >
  322. <can then be used to append one file to the next in order to ?
  323. =reconstruct the original tree file. Not the best, but better 
  324. than block by block.
  325. Quit: Enter 'Q' to complete the destination file.
  326. ESC: Entering ESC at any point in the program resets <
  327. :to the initial screen. At the initial 'Slot' request, ESC 7
  328. quits the program. The destination file is not saved.
  329. Icons
  330. :     CF.RES.ICONS contains Change-A-File and Resurrection ?
  331. =icons. The Change-A-File icon is courtesy of Karl Bunker. To ;
  332. 9use these icons in the Finder, place CF.RES.ICONS in the (
  333. &ICONS subdirectory of the boot volume 8
  334. 6(BOOT.VOLUME/ICONS/CF.RES.ICONS) and reboot.  The two 3
  335. 1programs must have file names of CHANGE.FILE and 
  336. RESURRECTION.
  337. -------------------------------------------------------
  338.  IMPORTANT NOTICE
  339. Auto-Restore is not accessible unless you have the ;
  340. 9CHANGE-A-FILE password. If RESURRECTION is placed in the >
  341. <same directory as CF.SYSTEM, the Auto-Restore function will 9
  342. 7be unlocked on entering the password and then quitting 
  343. CHANGE.FILE.>
  344. Transfer the CHANGE.FILE and RESURRECTION files to the 7
  345. 5volume directory of a disk under ProDOS (P8). Rename ;
  346. 9CHANGE.FILE to CF.SYSTEM. Be sure this file is the first >
  347. <.SYSTEM file in the directory (e.g. ahead of BASIC.SYSTEM). >
  348. <Boot the disk. (You must boot directly into CF.SYSTEM.) The >
  349. <password screen will be presented. Enter the password. When :
  350. 8the menu is presented, select Quit. CHANGE.FILE will be =
  351. ;rewritten to the disk without the screen. The Auto-Restore ?
  352. =function of RESURRECTION will be activated. Rename CF.SYSTEM ?
  353. =to CHANGE.FILE or any other name of your choice. Whether you 8
  354. 6have the password or not, the password screen will be =
  355. ;removed. If you enter the password, all the utilities will ?
  356. =be able to be used in both programs. If not, only the 'free' %
  357. utilities will be able to be used. 
  358. The CHANGE-A-FILE password can be obtained for $10.00
  359. from:
  360. Change.File!
  361. c/o Harold D. Portnoy
  362. 1431 Woodward&
  363. Bloomfield Hills, MI 48013
  364. 6     To obtain unlocked versions of Change-A-File and ;
  365. 9Resurrection and the password (for future versions) on a 8
  366. disk, send $10.00 plus $4.00 for postage and handling.
  367. ------------------------------------------------------------
  368. All rights reserved.
  369. AppleWorks, copyright Claris Corporation
  370. ProSel, copyright Glen Bredon
  371.      Suggestions, bugs and other trivia to:
  372.         Harold D. Portnoy
  373.         Compuserve [75156,2436]
  374.         GEnie [H.PORTNOY]
  375. Versions:
  376. 1.0- First attempt.0
  377. 1.1- Improved layout and docs. Adds scan.
  378. 1.2- Adds Auto-Restore.4
  379. 1.3- Improved Auto-Restore. Also removes bug.3
  380. 1.4- A few bug fixes and minor improvements.;
  381. 1.5- Improved determination of volume size and a bug
  382. fix.-
  383. 1.6- Adds Auto-Restore by Index Block.0
  384. 1.7- Improved algorithm for Auto-Restore.8
  385. 1.8- Improved algorithm for finding index blocks 1
  386. (because of comments from J. Wisnia).<
  387. 1.9- Much better algorithm for finding index blocks. :
  388. Similar to that in ProSel Block Warden. Thanks'
  389. to G. Bredon for his input.%
  390. 2.0- Add Diagnostics.
  391. 2.1- Much improved and simplified Diagnostics.>
  392. 2.2- Diagnostics further improved to reduce number of 
  393. unmatched files that need to be tested.>
  394.      2.3- Diagnostics bug fix. Complete Diagnostics or only 
  395. bad blocks.>
  396. <     2.4- Further improvements in Diagnostics particularly 
  397. useful for large volumes.6
  398. 2.6- Mark bad blocks as used in volume bit map.=
  399. 2.7- Diagnostics improved to include detection of bad &
  400. index blocks in ADB files.1
  401. 2.8- Fix bug in Auto-Restore by File Name.;
  402. 2.9- Diagnostics now detect bad index blocks in ABD =
  403. and AWP files. If file has bad index block, Auto-3
  404. Restore by file name will restore file.
  405.