lua-users home
lua-l archive

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


Mike Pall <mikelu-1011 <at> mike.de> writes:
> -- And in the future ...
> ffi.cdef[[
>   int mkdir(const char *pathname, unsigned int mode);
>   int rmdir(const char *pathname);
> ]]
>
> ffi.C.mkdir("/tmp/test", 0x1ff)    -- Yes, it's that simple!
> ffi.C.rmdir("/tmp/test")

Have you considered getting this information by reading DWARF symbols as
an alternative to parsing C code?  That could lead to an easier-to-use
interface for the case where you are calling into a shared lib.

libc = ffi.loadso("/lib/libc.so")
libc.mkdir("/tmp/test", 0x1ff)

Josh