[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How to change io::f_seek to use 64 bit numbers
- From: "Todor Totev" <umbra.tenebris@...>
- Date: Thu, 02 Oct 2008 16:56:30 +0300
On Wed, 01 Oct 2008 12:00:33 +0300, Shmuel Zeigerman <firstname.lastname@example.org>
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.