lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Miles Bader wrote:
Duck <duck@roaming.ath.cx> writes:
3. An I/O library compatible with 'io' but using the OS's own low-level routines, not FILE *. (Inability to work with files > 2GB is a great annoyance when using Lua on Linux or Windows. Point it at such a file and it's lost -- seems a rather depressing singularity to me.)

Er, shouldn't the C library be able to handle large files using FILE?

Yes, but you typically have to use a slightly different set of APIs --- fseeko() instead of fseek(), for example, in order to get the 64-bit file offset.

Also, 64 bit file offsets can't be expressed inside a standard Lua number (which only have 32 bits of integer precision). I'm not sure how you'd work around this.

--
David Given
dg@cowlark.com