#: 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
|