[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJIT FFI file/directory iterator help needed
- From: "Dimiter \"malkia\" Stanev" <malkia@...>
- Date: Mon, 06 Jun 2011 10:39:13 -0700
I've just wrote something last thursday. But I gave up, when I came to
OSX and Linux.
The problem for me was "struct dirent" - it's defined very differently
on various "unix" like platforms, and can't be exposed safely. Well one
can do it, if he is very.
For Windows that was easier - for 64-bit might be just a bit trickier,
and if UNICODE support is needed might complicate it a bit (but can it
be done easy through lua).
I also want to use only FFI, and nothing else (it's for a different
reason, I just don't want to deal with one more and one more compilation
- having luajit binary/dll for each platform, and then having pulled
certain other "C" library that I can use - whether I recompiled or
someone else - it won't matter).
On 6/6/2011 6:42 AM, Attila wrote:
Can somebody help me with LuaJIT FFI? I don't really understand it's
mechanism, I used alien to iterate through a directory's files (I don't
like os.execute with DIR/LS command, because it flashes the shell, and
that's an ugly solution I think). This code worked well:
If that possible to rewrite it with LuaJIT, but without any additional
dll? I don't know C/C++, I am mainly Lua programmer, so please help :)