I would look at the source for the file lib and see what it expects. I am guessing a userdata with metatable. If you can make the same sort of object, it should Just Work.
Sent from my new BlackBerry Z10
I have a FILE* which I would like to pass from a C function to a Lua
function, such that the Lua code can treat it as an io.* file (i.e. call
methods on it like file:read(), file:seek(), file:close() etc.)
Is there any way to do this?
Unfortunately opening the file from within Lua is not possible in this
case; A 3rd-party library has already opened the file (and the API
offers no way to obtain the path.)