{"comment":{"created_at":"2011-10-23T23:26:59Z","body":"I'm rather compiler-poor at the moment; but I can point you to the code at https://github.com/rrthomas/luaposix/blob/master/lposix.c#L583\r\nthis will transform a lua file object into a fd for you.\r\n\r\nOtherwise for sockets, as you know you have get_fd.\r\n\r\nSo, as a C function, I'd check if the metatable is the file metatable; if so use the above routine; otherwise just try and call the get_fd method..... Other libraries can then be made to work by adding get_fd functions to their methods.\r\n\r\n","updated_at":"2011-10-23T23:26:59Z","url":"https://api.github.com/repos/brimworks/lua-ev/issues/comments/2498522","id":2498522,"user":{"avatar_url":"https://secure.gravatar.com/avatar/881c58b5fb48ce1b9889bbd5687ae96b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"881c58b5fb48ce1b9889bbd5687ae96b","url":"https://api.github.com/users/daurnimator","id":127971,"login":"daurnimator"}},"action":"created","issue":{"number":5,"created_at":"2011-10-22T23:58:54Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Could you add a way to use normal lua file descriptors?\r\nSee: http://www.lua.org/source/5.1/liolib.c.html#getiofile\r\n\r\nFor usabilitiy; it might be nice if there was a tolibevio(x) funtion that would take a lua file object, socket object or other io types and convert them to an io object for libev.","comments":2,"title":"Interoperability with lua file objects","updated_at":"2011-10-23T23:26:59Z","url":"https://api.github.com/repos/brimworks/lua-ev/issues/5","id":2024918,"assignee":null,"milestone":null,"closed_at":"2011-10-23T23:26:59Z","user":{"avatar_url":"https://secure.gravatar.com/avatar/881c58b5fb48ce1b9889bbd5687ae96b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"881c58b5fb48ce1b9889bbd5687ae96b","url":"https://api.github.com/users/daurnimator","id":127971,"login":"daurnimator"},"html_url":"https://github.com/brimworks/lua-ev/issues/5","labels":[],"state":"closed"},"legacy":{"issue_id":2024918,"comment_id":2498522}}