[Info-vax] Empty blocks in FILES-11 directory files.
Arne Vajhøj
arne at vajhoej.dk
Mon Sep 26 18:50:50 EDT 2022
On 9/26/2022 4:42 AM, Johnny Billquist wrote:
> On 2022-09-25 15:00, Mark Daniel wrote:
>> On 25/9/2022 5:01 pm, Volker Halle wrote:
>>> 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.
Fixed length files are also padded to even number bytes.
But the "standard" FIX 512 is even.
Arne
More information about the Info-vax
mailing list