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?

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