[Info-vax] SCP2 and large files
Arne Vajhøj
arne at vajhoej.dk
Wed Aug 12 11:29:42 EDT 2020
On 8/12/2020 8:48 AM, John Reagan wrote:
> On Wednesday, August 12, 2020 at 2:47:52 AM UTC-4, Jeremy Begg wrote:
>> a. Can the CRTL stat() routine be told to guess the file size from the
>> RMS file header (ALQ perhaps)? I thought there might be a DECC$ feature
>> logical to do this, but I can't find it.
>
> You mean "st_size" in the stat buffer, yes? We do use RMS (if the file is on network device, we'll fall back to a $QIOW/IO$_ACCESS and dig through the FAT but I doubt you are doing that path)
>
> 1 51613 if (fhc->xab$l_ebk != 0) /* Calculate file size in bytes */
> 1 51614 stat_buf->st_size = (off64_t)(fhc->xab$l_ebk - 1) * RMS_BLOCKSIZE + fhc->xab$w_ffb;
> 1 51615 else
> 1 51616 stat_buf->st_size = (off64_t)fhc->xab$l_hbk * RMS_BLOCKSIZE + fhc->xab$w_ffb;
One should just remember that the relationship between "size of file on
disk" and "bytes that will be read from file" can be rather complex on
VMS.
Arne
More information about the Info-vax
mailing list