[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: file:seek("end") returns -1 on big files
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 1 Mar 2021 11:17:48 -0300
> 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
At the end of that discussion, we suggested using functions POSIX-named
(fseeko, ftello, off_t), while here you are using fseeko64, ftello64,
off64_t. What are the pros/cons of each of these choices?
-- Roberto