[Info-vax] Empty blocks in FILES-11 directory files.
Johnny Billquist
bqt at softjar.se
Mon Sep 26 04:42:39 EDT 2022
On 2022-09-25 15:00, Mark Daniel wrote:
> On 25/9/2022 5:01 pm, Volker Halle wrote:
>> Mark,
>
> Thanks for the detailed response Volker.
>
>> does your utility read until the 'End of file block' or the 'Highest
>> block' of the directory file ?
>
> It uses a "generic" file read function as "raw" blocks into memory. It
> reads the exact number of bytes indicated by the file header.
>
> if (odsptr->XabFhc.xab$l_ebk <= 1)
> SizeInBytes = odsptr->XabFhc.xab$w_ffb;
> else
> SizeInBytes = ((odsptr->XabFhc.xab$l_ebk-1) << 9) +
> odsptr->XabFhc.xab$w_ffb;
Are directory files in ODS-2 using fixed size records? Because otherwise
you have a problem here that you cannot compute how many bytes you have
in a file like this.
The ffb tells where the first free byte is, so that appends to a file
can be done. However, the number of bytes you actually have in a file
does not include the record lengths of variable sized records, nor the
padding for odd length records. But these things only happen on variable
record length files, which is why I ask.
In ODS-1, the records are fixed length, but then again, ODS-1 filenames
are very much more limited, and the directory format is much simpler.
Johnny
More information about the Info-vax
mailing list