[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: any plan about luajit2 support 5.2!
- From: Josh Haberman <jhaberman@...>
- Date: Thu, 18 Nov 2010 19:47:16 +0000 (UTC)
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