[Info-vax] 64-bit file sizes, was: Re: scp or sftp: file is "raw", needs to be parsed - possible to work around that?
Craig A. Berry
craigberry at nospam.mac.com
Thu May 20 14:27:50 EDT 2021
On 5/20/21 12:59 PM, Simon Clubley wrote:
> On 2021-05-20, Stephen Hoffman <seaohveh at hoffmanlabs.invalid> wrote:
>>
>> And now I'm pondering what the eventual advent of 64-bit file sizes
>> will do to existing apps and APIs...
>>
>
> That's a good question.
>
> It's a pity that on VMS, when using the VMS APIs instead of the C ones,
> you can't just use a 64-bit version of stat() with appropriate 64-bit
> integer variables, compile your code, and then call it a day. :-(
>
> I wonder if sizes will be locked at the current maximum size for the
> older APIs (with the value varying depending on whether you are working
> in blocks or bytes) with yet _another_ set of APIs to get and manipulate
> the 64-bit file size.
>
> It's also possible that when using higher-level languages such as C
> with the C APIs they may just do what Linux does and just call
> different versions in the glibc stat() call depending on whether you
> are working with 32-bit or 64-bit variables.
Large file support has been available in the CRTL for quite a few years.
If you define either _LARGEFILE or _USE_STD_STAT, then decc$types.h
defines __USE_OFF64_T, and you can see what that does to the type of off_t:
# if __USE_OFF64_T
typedef __int64 __off_t;
# else
typedef int __off_t;
# endif
so the file size in the stat struct (which has type off_t) can be a
64-bit integer if you want it to be. I can't remember when this came
along, but I believe it was before 8.x, possibly in the 7.3-2 era.
More information about the Info-vax
mailing list