File Recovery (recovr.Bp)

Developer(s): Bob Mitchell
Date: 1988
Type: Program
Platform(s): TS 2068
Tags: Utility

Brings back an ERASEd file on a Larken LKDOS disk, as long as none of its tracks has been written over. Give the file name; a 103-byte routine POKEd at 63000 loads the directory track, the program finds the name, scans tracks 1 to 79 for the ones that carry the file, marks them as used again in the track map, restores the name and saves the directory back.

It is for the original Larken LKDOS (the old LDOS interface board, 1960 bytes per track), so there is no download. Five spots at the left edge of the printed listing are hidden under a punch hole.

Published in Sinc-Link July-August 1988 (Bob’s Notebook: Disk Management Utilities).

Related Articles

Related Content

Source Code

 100 REM !USR 55000
 102 REM !LEN $<=20
 104 REM ! LIST
 120 REM ! OPEN #
 [illegible]0 LET curtrack=23728: POKE cu
rtrack,0
 135 DIM g$(9): DIM x$(9): DIM y
$(9): DIM z$(9): DIM a(79): DIM
b(22)
 140 RESTORE 5500: FOR o=63000 T
O 63102: READ p: POKE o,p: NEXT
o
 145 CLS : PRINT AT 3,0;"      L
ARKEN LKDOS UTILITY"''"
 FILE RECOVERY"''"This program w
ill recover a filethat has been
ERASEd providing  that none of i
ts tracks has beenoverwritten by
 other material."''"      by Bob
 Mitchell 1988  "
 146 LET st=0
 150 INPUT "name of file to be r
ecovered? ",i$
 151 IF LEN i$<9 THEN LET i$=i$+
" ": GO TO 151
 152 LET y$=i$
 155 RANDOMIZE USR 63000
 157 CLS : BEEP .1,10: PRINT "se
arching directory  track for"'y$
 160 FOR i=63608 TO 65478
 170 IF PEEK i=255 THEN FOR j=1
TO 9: LET x$(j)=CHR$ PEEK (i+j):
 NEXT j: IF x$(2 TO )=y$(2 TO )
THEN GO TO 200
 180 NEXT i
 190 GO TO 2000
 200 PRINT 'y$;" found"'': BEEP
.1,10: PRINT "scanning for track
s containing "'y$''"track #s are
[illegible]: FOR i=1 TO 79
 [illegible]5 POKE curtrack,i
 210 OUT 34,3: PAUSE 3
 220 RANDOMIZE USR 63006
 230 FOR j=1 TO 9: LET z$(j)=CHR
$ PEEK (j+63505): NEXT j
 240 IF z$(2 TO )=y$(2 TO ) AND
i<80 THEN GO SUB 300
 250 NEXT i
 255 GO SUB 350
 260 GO TO 400
 300 IF PEEK 63505=0 THEN RETURN
 310 LET a(i)=PEEK 63505
 320 RETURN
 350 LET i=1: FOR t=1 TO 79
 355 IF a(t)=0 THEN GO TO 370
 360 LET b(i)=a(t): PRINT b(i);"
,";
 365 LET i=i+1
 370 NEXT t
 380 PAUSE 60
 400 POKE curtrack,0: RANDOMIZE
USR 63000
 401 IF st THEN STOP
 405 CLS : BEEP .1,10: PRINT '"c
orrecting track map"
 410 FOR j=1 TO 22: FOR i=63529
TO 63607: IF PEEK i=b(j) THEN PR
INT PEEK i;" changed to: ";: POK
E i,(b(j)+128): PRINT PEEK i
 420 NEXT i
 430 NEXT j
 500 IF st THEN STOP
 502 BEEP .1,10: PRINT "restorin
[illegible]e name  and tracks used."
 [illegible] FOR i=63608 TO 65478 STEP 3
4
 520 IF PEEK i=255 AND PEEK (i+1
)=254 THEN FOR j=1 TO 9: LET g$(
j)=CHR$ PEEK (i+j)
 535 IF j>=9 THEN GO TO 545
 540 NEXT j
 545 IF g$(2 TO )=y$(2 TO ) THEN
 LET m=i: IF PEEK (m+1)=254 THEN
 GO TO 600
 550 NEXT i
 560 GO TO 730
 600 POKE m+1,CODE y$
 605 FOR p=1 TO 22
 610 IF b(p)<>0 THEN POKE m+p+10
,(b(p)+128)
 615 IF b(p)=0 THEN GO TO 630
 620 NEXT p
 630 POKE m+p+10,249
 700 POKE curtrack,0
 720 RANDOMIZE USR 63003
 730 CLS : LET st=1: PRINT "Task
 Completed. Check Catalogue."''"
PRESS A KEY"
 735 PAUSE 0
 740 STOP
2000 PRINT #1;AT 0,0;"File not f
ound": BEEP .5,.1: PAUSE 100: ST
OP
5500 DATA 195,43,246,195,72,246,
195,104
5501 DATA 246,243,205,98,0,201,5
8,100
5502 DATA 0,251,221,205,33,246,5
8,176
5503 DATA 92,50,29,32,205,126,0,
205
5504 DATA 123,0,33,112,32,17,16,
248
5505 DATA 1,192,7,237,176,195,38
,246
5506 DATA 205,33,246,58,176,92,5
0,29
5507 DATA 32,33,16,248,17,112,32
,1
5508 DATA 192,7,237,176,205,150,
0,205
5509 DATA 126,0,205,120,0,195,38
,246
5510 DATA 205,33,246,205,129,0,2
05,123
5511 DATA 0,33,112,32,17,16,248,
1
5512 DATA 192,7,237,176,195,38,2
46,0
8100 REM ! CLOSE #
8999 STOP
9000 CLEAR : RANDOMIZE USR 100:
SAVE "recovr.Bp" LINE 1
9010 STOP
9100 CLEAR : SAVE "recovr.Bp"

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.