lua-users home
lua-l archive

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

>    Is it legitimate to compare "if _OUTPUT = _STDOUT then ..."?

Yes, no problem at all (well, you need to use "==" instead of "=" ;-).

> Is it further legal to compare an object of unspecified type to _STDOUT to 
> test if it is the stdout file handle? (I'm assuming that if the type isn't 
> userdata then the compare will fail quickly based solely on type.) 

Yes (Right).

> I also wonder why the ishandle() routine in the iolib isn't exposed in
> the API?  Will I need that function to handle this "properly"?

  function ishandle (h)
    return tag(h) == tag(_STDIN)

-- Roberto