[Coco] f83 for the CoCo, Update and a laundry-list of questions.
Darren A
mechacoco at gmail.com
Sun Nov 9 12:26:53 EST 2008
On 11/9/08, Brett Heath wrote:
>
> ...
>
> With one exception the file interface to Disk EDTASM and OS9 (and
> presumably Nitros) looks to
> be fairly straightforward. The exception is determining file size. The
> only way I see to do this
> in EDTASM DOS is to do repeated reads if increasing record numbers
> until an error is returned, inelegant to say the least.
In RSDOS, walking the FAT will tell you many granules the file uses
and how many sectors are used in the last granule. Bytes 14 and 15 of
the file's directory entry indicate how many bytes are used in the
last sector. The file's size can then be calculated as:
fileSize = (numGrans - 1) * 2304 + (lastGranSectors - 1) * 256 + lastSectorBytes
> A more fundamental problem is that I haven't found any way to find out
> from RSDOS if
> a diskette has been changed, and thus that the resident RAM copy of a
> drive's FAT is no
> longer valid.
>
> Please tell me that I've missed something.
Each of the RAM resident FAT tables are preceded by a 6-byte header.
Only the first two bytes are used. The first byte indicates how many
files are open on the drive. The second byte is the Dirty Flag. When
the second byte is 0, the RAM resident FAT has not been modified.
Darren
More information about the Coco
mailing list