[net.micro.cpm] need directory information

johnbl@tekig5.UUCP (John Blankenagel) (05/21/85)

     I am trying to write a program similar to xdir for my cpm 
computer.  I need some information on how to access the directory
tracks on the disk.  Also, how do I use the disk parameter block
to find disk usage information?  I will be writing the program in
C (Software Toolworks c-80).  Any helpful information would be
greatly appreciated.

John Blankenagel.

Bicer.OsbuSouth@XEROX.ARPA (05/23/85)

---------
     I am trying to write a program similar to xdir for my cpm 
computer.  I need some information on how to access the directory
tracks on the disk.  Also, how do I use the disk parameter block
to find disk usage information?  I will be writing the program in
C (Software Toolworks c-80).  Any helpful information would be
greatly appreciated.
---------


The easiest and most portable way that I know of, is to set up a
fully ambiguous FCB (all ?'s), and do a BDOS search for FIRST,
look at the directory entry at the default DMA buffer (i.e 80H),
then continue doing BDOS search for NEXT and examining the directory 
entry, until the function returns no more matches (i.e. all the file
names on the disk in the current user area have been shown).

	1 - Set up fully ambiguous FCB (all ?'s)
	2 - BDOS search for FIRST
	3 - If no match found, DONE
	4 - Examine the directory entry, update internal data
	5 - BDOS search for NEXT
	6 - If no match found, DONE
	7 - GOTO Step 4

One of the best documents I know which explains the directory entries
is the DU (Disk Utility) documentation. This program is in public
domain, and I would recommend you learn how to use it and understand 
the information it provides, before you start the project.

Good luck.

	Jack Bicer