lua-users home
lua-l archive

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


Luiz Henrique de Figueiredo wrote:
Also, 64 bit file offsets can't be expressed inside a standard Lua number (which only have 32 bits of integer precision).

IEEE doubles can store 52 bits of integer precision (but it does not
help in this case).

They certainly do --- apparently it's not my day today.

However, since 52 bit offsets are capable of handling files up to two exabytes long (including a bit for the sign; and assuming I haven't made a trivial mistake in the maths, which is certainly possible right now), I think the OP could probably solve their immediate problem by patching io to use fseeko and ftello and to pass offsets around as doubles. Call it... medium file support.

2EB of enough to store 20 years of continuous DV. I don't really know why I worked that out.

--
David Given
dg@cowlark.com