lua-users home
lua-l archive

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


>How can I detect that an argument is an filehandle?

Compare its metatable with that of io.stdin:

function isfilehandle(f)
 return getmetatable(f)==getmetatable(io.stdin)
end

--lhf