[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Problem using posix library pipe() from luajit2?
- From: Javier Guerra Giraldez <javier@...>
- Date: Sun, 27 Mar 2011 07:48:48 -0500
On Sun, Mar 27, 2011 at 6:11 AM, Mike Pall <mikelu-1103@mike.de> wrote:
>
> It looks like luaposix copies the internal metatable for files and
> attaches it to their own userdata object. This doesn't work with
> LuaJIT. luaposix shouldn't access internals of the VM in this way.
that's unfortunate. i've had to do similar things sometimes, since
there's no clean way to get to the FILE* from the file object. the
alternative is not to accept Lua file objects for any C extension that
uses files.
I guess the best would be to export the tofile() function in liolib.c
(i'm reading some old sources here, maybe could be there for Lua 5.2?)
> But with LuaJIT there's no need to use luaposix. You can directly
> access all POSIX C library functions with the FFI library.
...except for compatibility
--
Javier