[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: how to detect if argument is a file handle
- From: Markus Huber <pulse@...>
- Date: Tue, 19 Nov 2002 17:35:50 +0100 (GMT)
How can I detect that an argument is an filehandle?
The function accepts strings and filehandles as the first argument. I
prefer to check the state like this:
if type(Argument)=="string" then
elseif "Argument is a Filehandle" then
end
Instead try to work like that:
if type(Argument)=="string" then
else
end
The old tag method
tag(Argument)==tag(_STDIN)
don't work with Lua version 5.
Thanks.
--
Markus