home *** CD-ROM | disk | FTP | other *** search
/ News-Disk 8 / News_Disk_Issue_08_19xx___BASIC.atr / err164.doc < prev    next >
Text File  |  2023-02-26  |  3KB  |  1 lines

  1. This article has been taken from Z*MAG on-line newsletter issue 205. It deals with what to do if you get an error 164.¢-----------------------------------¢¢===================================¢* Z*MAGAZINE ARCHIVES - 1987¢===================================¢¢¢#:  201366 S3/Utilities 15-Dec-87 03:04:41¢Sb:  #201344-#mess.fix¢Fm:  Bill Wilkinson [OSS] 73177, 2714¢To:  MR GOW 73167, 3607¢¢There is NO program that can GUARANTEE to fix a disk when you get an error 164.¢¢An error 164 usually results when you have two files trying to use the same spot on the disk.  This usually happens because you have saved one file to disk, done something illegal, and then saved a second file to the same disk.  The second file is probably okay and is probably completely accessible.  But the first file is simply GONE because the second file has written over the top of it.  Period.¢¢Can you recover part of the damaged file?  Possibly.  But I would suggest that unless it is a text file (e.g., a word processing data file or possibly a LISTed -- NOT SAVEd -- program) the effort is bound to fail.  Most SAVEd files, whether binary files or BASIC programs, simply CAN NOT be restored if they are missing pieces.  Sorry.¢¢Having said all that, what CAN you do with a damaged disk?  Well, the DISKFIX utility that is part of DOS 2.5 will at least TRY to recover as much of a disk as it can.  But if it decides a file is damaged beyond repair, it simply removes the file from the directory!  So I would recommend making a sector copy of any damaged disk before attempting to use DOS 2.5's DISKFIX.COM program.¢¢You can get DISKFIX here on CIS, in the DL's (DL 3, file DISKFI.*).  But I personally recommend that you send off to Atari for a copy of not only a disk with DOS 2.5 but also a really good manual.  The manual alone is worth the $10 or so that Atari charges.¢¢Finally:  The Atari DOS manual suggests this program to recover as much as possible of a damaged file, so long as the file is not bigger than available RAM in your machine:¢¢10 PRINT "INSERT DAMAGED DISK THEN GIVE NAME OF FILE TO RECOVER ";¢20 F=FRE(0)-300 :  DIM BUF$(F), FILE$(20)¢30 INPUT FILE$¢40 OPEN #1, 4, 0, FILE$¢50 TRAP 100¢60 FOR I=1 TO F :  GET #1, B :  BUF$(I)=CHR$(B)¢70 NEXT I¢80 PRINT "FILE TOO BIG"¢90 END¢100 REM GET HERE ON ERROR...¢110 TRAP 120 :  CLOSE #1¢120 PRINT "INSERT FORMATTED DISK THEN GIVE NAME TO SAVE FILE TO ";¢130 INPUT FILE$¢140 OPEN #2, 8, 0, FILE$¢150 PRINT #2; BUF$ ;¢¢You could be neat and add line 160:¢¢160 END¢¢Finally, line 150 might be safer done as:¢¢150 FOR J=1 TO I-1 :  PUT #2, ASC(BUF$(J)) :  NEXT J¢¢OOPS...One more finally.¢¢In one of my articles in COMPUTE in that last year, I discussed probable causes of messed up disks. I noted that I personally have virtually NEVER had a disk messed up by DOS.  Reason:  I never never never change disks unless the program tells me to do so.  If I am changing disks while using BASIC, I always type "END" before doing so.  In desperation, I will hit RESET before changing.¢¢The single most common cause of disk crashes is inserting a new disk while a file (or files) is still OPEN for output on the first one.  This can happen with word processing programs, data bases, etc., etc.  ALWAYS WAIT for the program to tell you it is time to swap disks.  ALWAYS use the menus to get to the "disk change" point.  NEVER just yank a disk and plunk in a new one.¢¢