1 Oct 2008 11:00
Re: How to change io::f_seek to use 64 bit numbers
Shmuel Zeigerman <shmuz <at> 013net.net>
2008-10-01 09:00:33 GMT
2008-10-01 09:00:33 GMT
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). -- -- Shmuel
RSS Feed