lua-users home
lua-l archive

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


On Wed, 01 Oct 2008 12:00:33 +0300, Shmuel Zeigerman <shmuz@013net.net> wrote:

Todor Totev wrote:
I'd like to use (platform specific) fseek with 64-bit file offsets inside io lib f_seek function.
But it gets the lua number with luaL_optlong which truncates it to long.
What do you suggest me to fix it?

Either patch Lua with your platform-specific fseek, or write a library.

Use luaL_optnumber rather than luaL_optlong, cast it to whatever is a 64-bit integer type on your platform, then you'll be able to get/set offsets up to 2^53 bytes (assuming lua_Number is double).


luaL_optnumber is what I need, thank you very much.