lua-users home
lua-l archive

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


Hi Shmuel,

I have this patch in my Lua makefile:

    # need to patch Lua io to support large (>2GB) files on Windows:
    # http://lua-users.org/lists/lua-l/2015-05/msg00370.html
    cat <<EOF >>src/luaconf.h
#if defined(liolib_c) && defined(__MINGW32__)
#include <sys/types.h>
#define l_fseek(f,o,w) fseeko64(f,o,w)
#define l_ftell(f) ftello64(f)
#define l_seeknum off64_t
#endif
EOF

See the earlier discussion on this topic:
http://lua-users.org/lists/lua-l/2015-05/msg00315.html

Paul.

On Sun, Feb 28, 2021 at 11:36 AM Shmuel Zeigerman <shmuz@013net.net> wrote:
>
> Hello,
>
> When I call file:seek("end") on a file which size is 4000 megabytes it
> returns -1.
>
> This occurs with all versions of Lua 5.1-5.4 compiled with MinGW on
> Windows 10.
>
> LuaJIT 2.1.0-beta3 (also compiled with MinGW) returns the correct value
> 4194304000.
>
> --
> Shmuel