Daniel Stenberg <[EMAIL PROTECTED]> writes: > On Tue, 11 May 2004, Hrvoje Niksic wrote: > >> That in itself is not a problem because, under Windows, off_t will be >> typedeffed to a 64-bit type if LFS is available, and to `int' otherwise. > > Sorry for my confusion, but when I think about it I believe Windows > _do_ have an off_t, but that is merely 32bit.
Ouch. In that case we can't just use off_t. Although I'm pretty sure I've seen application that purport to support LFS use off_t in the source code. Maybe they just don't care to support LFS under Windows. >> The point of my question was: should low-level code even care >> whether LFS is in use (by using off_t for various variables), or >> should it use intmax_t to get the largest representation available >> on the system? The latter is in principle sort of like using >> `long', except you're not tied to the actual size of `long'. > > In curl we went with curl_off_t for various variables and that is > then 32bit or 64bit depending on platform. I can't see many benefits > in using 64bit variables on systems that don't deal with 64bit > filesizes. Not everything is necessarily about local file sizes. For example, you might want to correctly parse and print the file size reported by the remote server. Or, you might want to be able to download only a chunk of a huge file (and correctly display the progress bar while doing it.) Additionally, Wget already uses a large integer type for quantities that span a bunch of files, such as download quota. Even in a 32-bit Wget you can say `--quota=150G' and it just works.
