[Coco] OS9 directory from BASIC
robert.gault at worldnet.att.net
Thu Aug 2 10:12:14 EDT 2007
Bob Devries wrote:
> Hi people,
> Has anyone here ever tried to write a BASIC programme to read a
> directory from an OS9 disk?
> I'm thinking about all the times I've wanted to see what's on an os9
> disk, but really didn't want to take the time to boot up into OS9.
Here is a prototype to get you or anyone else going. It will read the
OS-9 root directory for most any type of OS-9 disk whether single or
double sided as long as the sector size is 256bytes. It also assumes
that the maximum number of entries in the root directory fit in one
sector. It assumes that the root directory immediately follows the
descriptor, which probably is always true but does not need to be.
Things needed to be done.
1) Read the actual size of the root directory and then read the entire
directory skipping deleted entries.
2) Determine when an entry is a sub-directory, find it and read it.
3) If sub-directories are to be read, handle 40 and 80 track disks and
double sided disks.
4) Handle directories that have separated desciptors and contents.
10 WIDTH80:CLS:PRINT" OS-9 DISK DIRECTORY READER "
30 PRINT:INPUT"SELECT DRIVE# TO BE USED <0-3>";DR
40 PRINT"INSERT DISK AND HIT ANY KEY WHEN READY"
50 PRINT"HIT ANY KEY WHEN READY"
More information about the Coco