lua-users home
lua-l archive

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


On 9/8/07, David Given <dg@cowlark.com> wrote:
> Is there a (standard) way I can get the FILE* corresponding to an io object,
> from C?

>From liolib.c:

#define topfile(L)      ((FILE **)luaL_checkudata(L, 1, LUA_FILEHANDLE))

FILE *fp = *topfile(L);

This assumes the file object is the first argument to your function.

     -Mark