Description: Apple II Pascal: Disk directory structure Header: Apple II Pascal: Disk directory structure Const maxdir= 77; {Maximum number of entries in directory} vidleng= 7; {Number of characters in volume ID} tidleng= 15; {Number of characters in title ID} fblksize= 512; {Standard disk block length} dirblk= 2; {Directory starts at this disk-block address} TYPE datarec= PACKED RECORD month: 0..12; {0 implies meaningless data} day: 0..31: {Day of the month} year: 0..100; {100 implies the dated volume is temporary} END {datarec}; vid= string[vidleng]; dirrange= 0..maxdir; tid= string[tidleng]; filekind= {untyped, xdskfile, codefile, textfile, infofile, datafile, graffile, fotofile, securedir}; direntry= PACKED RECORD dfirstblk: integer; {1st physical disk address} dlastblk: integer; {Points at block following last used block} CASE DFKind: filekind of Securedir, untypedfile: {Only in dir[0] - this is volume info} [Filler1: 0..2048; {waste 13 bits for compatability} dvid: vid; {name of disk volume} deovblk: integer; {last block in volume} dnumfiles: dirrange; {number of files in directory} dloadtime: integer; {Time of last access} dlastboot: daterec]; {Most recent date setting} xdskfile, codefile,textfile, infofile, datafile, graffile, fotofile: {regular file info} [filler2: 0..1024; {waste 12 bits for compatability} status: boolean; {for filer wildcards} dtid: tid; {title of file} dlastbyte: 1..fblksize; {Number of bytes in files last block} daccess: daterec}; {date of last modification} END; {case dfkind; direntry} directory = ARRAY[dirrange] of direntry; To use this information, do a UNITREAD on the desired volume. For example, PROGRAM ShowHow; All of the above declarations plus: VAR DirInfo: Directory; UnNum: Integer BEGIN UnNum:=4; UNITREAD(UnNum,DirInfo,SIZEOF(DirInfo),2); END. This program reads the directory inforation on volume 4 and stores it in the Directory variable DirInfo. The last parameter, 2, indicates to UNITREAD to start reading with block 2, where the directory information starts. With Pascal 1.3, you can chain to and from the filer and thereby easily handle files within programs. Pascal Technote #4 Keywords: