ROM Computer Magazine Archive ROM MAGAZINE ISSUE 4 — FEBRUARY/MARCH 1984 / PAGE 37

QUICK DOS
By PETER ELLISON

    Below is a program which I have been planning on writing ever since I got my disk drive. It is a program that allows the user to look at the disk directory, rename files, delete files, lock or unlock files, and format a disk without having to go into DOS. I figured you save five seconds everytime you use this program instead of DOS unless of course you are using the old DOS or DOS-MOD. But remember those DOSes take up memory this program only takes up disk space(eighteen sectors in all).
    By using the XIO command in BASIC I was able to access the file or files that I wanted to edit.
Below is a list of the XIO commands and what they do:

Function                    Command

LOCK   XIO 35,#1,0,0,"D:name"
UNLOCK XIO 36,#1,0,0,"D:name"
DELETE XIO 33,#1,0,0,"D:name"
RENAME XIO 32,#1,0,0,"D:name"
FORMAT XIO 254,#1,0,0,"D1:"


5 REM DISK UTILITY
10 REM REQUIRES 16K AND A DISK DRIVE
15 REM BY PETER ELLISON ROM VOL #1,ISSUE 4
25 ? ""
30 REM DECLARE VARIABLES
35 ? "Below is a list of your data files:"
45 DIM COM$(1),OLD$(14),N$(14),ANS$(1),P$(14),DEL$(14),LOC$(14),PRO$(14),A$(20),F$(14)
55 REM
56 REM OPEN DISK DIRECTORY
65 OPEN #1,6,0,"D:*.*":GOTO 85
75 ? "CAN'T READ DIRECTORY":END
85 COL=0:LINE=3
95 TRAP 155
105 INPUT #1;A$
110 REM SPACE OUT DIRECTORY
115 POSITION COL,LINE:? A$(1,17)
125 LINE=LINE+1
135 IF LINE>20 THEN COL=COL+17:LINE=3
145 GOTO 105
155 GOTO 165
165 LINE=21:COL=2:POSITION COL,LINE
166 ? A$
175 ? "You have a choice of six commands: They are L-LOCK,U-UNLOCK, D-DELETE, R-RENAME,F-FORMAT, OR P-RUN"
185 ? "Input the command that you wish to use";:INPUT COM$
195 IF COM$="L" THEN 255
205 IF COM$="U" THEN 265
215 IF COM$="D" THEN 275
225 IF COM$="R" THEN 285
235 IF COM$="F" THEN 355
236 IF COM$="P" THEN 400
245 GOTO 185
255 REM LOCK FILE
257 ? "Enter in the name of the file that you wish to lock";:INPUT LOC$
259 F$="D:":F$(3)=LOC$
260 XIO 35,#1,0,0,F$
261 GOTO 175
265 REM UNLOCK FILE
266 ? "What is the name of the file that you wish to unlock";:INPUT A$
267 F$="D:":F$(3)=A$
268 XIO 36,#1,0,0,F$
270 GOTO 175
275 REM DELETE FILE
276 ? "What is the name of the file that you wish to delete";:INPUT DEL$
277 ? "Are you sure you want to delete-";DEL$;:INPUT ANS$
278 IF ANS$="N" THEN 175
279 F$="D:":F$(3)=DEL$
280 IF ANS$="Y" THEN XIO 33,#1,0,0,F$
281 GOTO 175
285 REM RENAME FILE
295 ? "Enter the name of the file that you wish to rename";:INPUT A$
305 7 "Enter the new name of file";:INPUT N$
315 ? "Do you wish to change ";A$;" to ";N$;:INPUT ANS$
325 F$="D:":F$(3)=A$
335 F$(LEN(F$)+1)=",": F$(LEN(F$)+1)=N$
344 IF ANS$="N" THEN 175
345 IF ANS$="Y" THEN XIO 32,#1,0,0,F$
346 GOTO 175
355 REM FORMAT DISK
356 ? "Insert the disk that you want format- ted."
357 ? "Are you sure you want to format this disk";:INPUT ANS$
358 IF ANS$="N" THEN 175
359 IF ANS$="Y" THEN XIO 254,#1,0,0,"D1:"
360 GOTO 175
400 REM RUN PROGRAM
410 ? "Which program do you wish to run";:INPUT PRO$
420 F$="D:":F$(3)=PRO$
430 RUN F$