[comp.sys.apple] ProDOS Disk Inventory Utility

patth@dasys1.UUCP (Patt Haring) (08/04/87)

              Documentation for Disk Inventory Utility v1.0B
                                By The Saint
                       (c) 870727  Aristos Unlimited 

This program is Public Domain.

  DIU is a ProDOS utility that will allow you to take an inventory of your
ProDOS disks and create a TXT file which could be used by AppleWorks.

  DIU will first ask for the Slot & Drive of the diskette to be inventoried.
This is selected using the light-bar selector. Next DIU will ask were the
information should be displayed (Printer, Screen, or Text file). With this
version 1.0B of DIU, output to text file is the only valid option. Selecting
Text file will promt for the FULL pathname of the text file to be created.
Full pathname means that you must specify the Volume name as well as the
filename [ex. /MYDISK/NEWFILE]. DIU will then read the directory from the
selected slot and drive and create a TXT file on the specified pathname.
The same TXT file may be used again for different disk. Each disk inventory 
will be appended to the previous one if the same name is used.

  To create an AppleWorks Data Base file from the TXT file, follow the
following instructions.

     1. From the Main Menu select option 1, "Add files to Desktop."
     2. Next, select option 4, "Make a new file for the Data Base."
     3. Select option 2, "Make a new file from a text (ASCII) file."
     4. Enter 9 to the question "How many categories per record?"
     5. Enter the complete pathname of the file created with DIU.
        [ex. /MYDISK/NEWFILE]

  After Appleworks has read the file, it will as for the name of the newfile.
This is the name of the Data Base file.

  There it is! Appleworks now has a Data Base file with an inventory of your
ProDOS disk(s).

  Now to fix-up the file.

  Press OA-N for "Rename categories." The categories should be changed to the
following:

     CATEGORY01 = Pathname             CATEGORY06 = Modified Time
     CATEGORY02 = Filename             CATEGORY07 = Create Date
     CATEGORY03 = Type (filetype)      CATEGORY08 = Create Time
     CATEGORY04 = Blks (Blocks)        CATEGORY09 = Endfile (Bytes)
     CATEGORY05 = Modified Date

  Press OA-L to "Change record layout."
Delete "Modified Time" & "Create Time."
"Filename" should be set at 15 spaces, since this is the maximum number of
charaters allowed in a ProDOS filename.
"Type" should be set to 3 spaces.
"Modified Date" & "Create Date" should both be set at 9 spaces.

-- 
Patt Haring                       UUCP:    ..cmcl2!phri!dasys1!patth
Big Electric Cat                  Compu$erve: 76566,2510
New York, NY, USA                 MCI Mail: 306-1255;  GEnie: PHaring

patth@dasys1.UUCP (Patt Haring) (08/04/87)

NEW
10REM  **   Disk.Inventory   **
20REM   ** The Saint   870727 **
30ONERRGOTO1000
40GOSUB770
50?D$"PR#3"
60VP=3:GOSUB890:VP=22:GOSUB890
70POKE34,3:POKE35,21
80VTAB1:POKEHT,5:?"Disk Inventory Utility v1.0B"
90VTAB1:POKEHT,55:?"Current date: ";M3;"/";M1;"/";M2
100VTAB5:POKEHT,17:?"Select Slot & Drive of diskette to inventory:"
110X1=30:X2=17:Y1=7:Y2=8:GOSUB910
120A$(1)="Slot 7, Drive 1":A$(2)="Slot 7, Drive 2":A$(3)="Slot 6, Drive 1"
130A$(4)="Slot 6, Drive 2":A$(5)="Slot 5, Drive 1":A$(6)="Slot 5, Drive 2"
140A=6:B=3:X1=32:Y1=9:GOSUB930
150ONAGOTO160,170,180,190,200,210
160SL=7:DR=1:GOTO220
170SL=7:DR=2:GOTO220
180SL=6:DR=1:GOTO220
190SL=6:DR=2:GOTO220
200SL=5:DR=1:GOTO220
210SL=5:DR=2:GOTO220
220HOME:VTAB5:POKEHT,28:?"Select output device:"
230X1=30:X2=15:Y1=7:Y2=6:GOSUB910
240A$(1)="Printer":A$(2)="Screen":A$(3)="Text file":A$(4)="Exit to BASIC"
250A=4:B=3:X1=32:Y1=9:GOSUB930
260IFA=1THENP%=1:GOTO760:REM ** not finished **
270IFA=2THENS%=1:GOTO760:REM ** not finished **
280IFA=4THEN760
290IFA=3THENT%=1:VTAB15:POKEHT,10:?"Enter FULL pathname of text file to create:"
300X1=10:X2=45:Y1=16:Y2=2:GOSUB910
310VTAB17:POKEHT,11:INPUTNA$
320IFLEN(NA$)=0THEN310
330IFLEFT$(NA$,1)<>"/"THENNA$="/"+NA$
340?D$"append";NA$
350DIRCAP=0
360FORX=1TO64:FIL$(X)="":DIR$(X)="":PTH$="":NEXT
370?D$"append";NA$
380HOME:?D$;"prefix,s";SL;",d";DR:?D$;"prefix":INPUTPR$
390CURDIR$=LEFT$(PR$,LEN(PR$)-1):DIR$(1)=CURDIR$:DCOUNT=1:CDIR=1
400?D$"PR#0":HOME:X1=15:X2=52:Y1=13:Y2=3:GOSUB910
410VTAB14:POKEHT,17:?"Processing directory number ";CDIR;" of ";DCOUNT;" director
ies."
420VTAB15:POKEHT,22:?"This is directory ";CURDIR$;"."
430VTAB20:GOSUB540
440IFDIRCAP=DCOUNTTHEN750
450FORCDIR=DIRCAP+1TODCOUNT
460CURDIR$=PTH$(CDIR)+DIR$(CDIR)
470?D$"PR#0":HOME
480X1=15:X2=52:Y1=13:Y2=3:GOSUB910
490VTAB14:POKEHT,17:?"Processing directory number ";CDIR;" of ";DCOUNT;" director
ies."
500VTAB15:POKEHT,22:?"This is directory ";CURDIR$;"."
510VTAB20:GOSUB540
520NEXTCDIR
530GOTO440
540CAPDIR$=CURDIR$+",tdir"
550?D$"open"+CAPDIR$
560?D$"read"+CURDIR$
570INPUTL1$:INPUTL2$:INPUTL3$:N=0
580INPUTL4$
590IFL4$<>""THENN=N+1:FIL$(N)=L4$:GOTO580
600IFN=0THENFIL$(1)=" <NO FILES>"
610INPUTL5$
620?D$"close"+CURDIR$:DIRCAP=DIRCAP+1
630IFP%ORS%THEN?L1$;:POKEHT,62-LEN(L1$):?:?L2$:?L3$:FORX=1TON:?FIL$(X):NEXT:?:?L5
$:?
640IFT%THENPTH$=CURDIR$:?D$"append";NA$
650IFT%THENFORX=1TON:FORY=1TO8:PP$(Y)=MID$(FIL$(X),J(Y,1),J(Y,2)):NEXTY:?PTH$:FOR
Y=1TO8:?PP$(Y):NEXTY:NEXTX
660FORX=1TON
670IFMID$(FIL$(X),18,3)<>"DIR"THENGOTO730
680DCOUNT=DCOUNT+1
690FORLN=2TO16
700IFMID$(FIL$(X),LN,1)=" "THENLN=LN-2:GOTO720
710NEXTLN
720DIR$(DCOUNT)=MID$(FIL$(X),2,LN):PTH$(DCOUNT)=CURDIR$+"/"
730NEXTX
740RETURN
750GOTO50
760TEXT:?D$"CLOSE":?D$"prefix/":HOME:END
770D$=CHR$(4):HT=1403:P%=0:T%=0:S%=0
780M1=PEEK(49040)-INT(PEEK(49040)/32)*32
790M2=INT(PEEK(49041)/2)
800M3=(PEEK(49041)-M2*2)*8+INT(PEEK(49040)/32)
810I$=CHR$(15):N$=CHR$(14):MT$=CHR$(27):OF$=CHR$(24)
820KB=49152:CK=49168
830DIMA$(10),J(8,2),FIL$(99),DIR$(99),PTH$(99),PP$(8)
840FORX=1TO8:READJ(X,1):NEXT
850DATA    2,18,23,31,41,48,58,64
860FORX=1TO8:READJ(X,2):NEXT
870DATA  15,3,6,9,5,9,5,8
880RETURN
890?I$;MT$;:VTABVP:FORA=1TO80/10
900?"SSSSSSSSSS";:NEXT:?N$;OF$:RETURN
910A$="":FORA=1TOX2:A$=A$+"_":NEXTA:VTABY1:POKEHT,X1+1:?A$:FORA=1TOY2:VTABY1+A:PO
KEHT,X1:?"|"A$"|":VTABY1+A:POKEHT,X1:?"|"SPC(X2):NEXT:VTABY1+Y2:POKEHT,X1:?"|"A$"
|"
920RETURN
930FORC=1TOA:VTABY1+C-1:POKEHT,X1:?A$(C):NEXTC:VTABY1-1+B:POKEHT,X1-1:?I$;" ";A$(
B);" ";N$:C=B:POKECK,0
940D=PEEK(KB):IFD<128THEN940
950IFD=155THEN50
960IFD=141THENPOKECK,0:VTABY1+B-1:POKEHT,X1-1:?I$;" ";A$(B);" ";N$:A=B:RETURN
970IFD=138ORD=149THENC=B:B=B+1:IFB=A+1THENB=1
980IFD=136ORD=139THENC=B:B=B-1:IFB=0THENB=A
990VTABY1+C-1:POKEHT,X1-1:?" "A$(C)" ":VTABY1+B-1:POKEHT,X1-1:?I$;" ";A$(B);" ";N
$:POKECK,0:GOTO940
1000ER=PEEK(222)
1010?FF$:X1=15:X2=52:Y1=12:Y2=3:GOSUB910
1020VTAB14:POKEHT,17:?"An unforeseen error #";ER;" has occured at line #";
1030?PEEK(218)+(PEEK(219)*256):TEXT:END
SAVE DIU.V1.0B

-- 
Patt Haring                       UUCP:    ..cmcl2!phri!dasys1!patth
Big Electric Cat                  Compu$erve: 76566,2510
New York, NY, USA                 MCI Mail: 306-1255;  GEnie: PHaring