lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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:
Dear All,

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:
http://pastebin.com/tJ0iFkyS
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 :)

Regards,
Attila