Yes, right. Can be fixed with luaposix though:getmetatable(io.stdin).getfd = function(s) return posix.fileno(s) end Alternatively a patch to the lua core. Here is one here /Flemming