[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaBinaries and the RTL DLL for 5.2
- From: Fabio Mascarenhas <mascarenhas@...>
- Date: Fri, 15 Jan 2010 16:02:54 -0200
On Fri, Jan 15, 2010 at 2:28 PM, Jerome Vuarand
> And I guess that they're extracting (undocumented) information from
> the file userdata created by the IO library. So the issue is not to
Yes, lfs.lock and lfs.unlock extract the FILE* pointer from the file
userdata, as the POSIX lock functions need a file descriptor. File
descriptors are not ANSI C, so it is not just a question of adding a
getfd() method to Lua files... so yes, lock and unlock would work if
you compiled io as a separate dll and lfs with the same runtime as io.
I think you will still have problems with lfs.setmode, though, if you
try to use it to change the mode of io.stdin, io.stdout or io.stderr,
if you do not link the io library with the same runtime as the
executable. The program won't crash, but setmode will have no effect.
> have LFS and Lua use the same runtime, but LFS and the standard io
> module (I for one build all standard modules, including io, as
> separate DLLs).
>> Keep in mind that the
>> static single threaded C runtime is deprecated.
> I've been using the multi-threaded one.