TIP: Click on subject to list as thread! ANSI
echo: cis.utilities
to: George Hendrickson 71071,2003
from: Pete Lyall 76703,4230
date: 1990-07-18 17:17:04
subject: #5315-Reading OS9 Directorys

#: 5323 S9/Utilities
    18-Jul-90  17:17:04
Sb: #5315-Reading OS9 Directorys
Fm: Pete Lyall 76703,4230
To: George Hendrickson 71071,2003

George -

Piece'o'cake...

Just open the directory as you would any file, and instead of just READ, open
it for READ + DIR modes.

Then, read it in 32 byte chunks. The chunks are broken down:

filename[29] LSN_of_FD[3]

If the 1st byte of filename is 0, then the file has been deleted. Also,
filenames may be less than 29 characters. The last character always has the
high-bit (i.e. 'A' + $80 = $C1) set.

The LSN is the absolute sector number where that file's File Descriptor Sector
(FD) is stored. In the FD sector is all the information about file owner,
dates, attributes, size, and physical mapping on the disk. Best bet is to read
the technical manual on the RBF file manager to get detailed breakdown on this.

BTW - what's the utility? It's hard to imagine a flavor of directory based
utility that hasn't already been written for OS9.

Pete

SOURCE: compuserve via textfiles.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.