[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: file:seek("end") returns -1 on big files
- From: Paul K <paul@...>
- Date: Mon, 1 Mar 2021 08:51:33 -0800
Hi Roberto,
> 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?
My vague recollection is that when the patch was made, I started with
your suggested change, but had a problem with the compiler not finding
*o functions, while *o64 functions were available (similar to the
symptoms discussed in this thread:
https://sourceforge.net/p/mingw/mailman/mingw-users/thread/49CB69BE.9040909%40laposte.net/#msg21936228).
I can't reproduce it with either mingw/gcc 9.2.0 or tdm/gcc 4.8.1 I
have access to, so it was probably related to some old version of
mingw/gcc I had at that time.
Paul.
On Mon, Mar 1, 2021 at 6:19 AM Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
>
> > 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