lua-users home
lua-l archive

Re: type checking tags

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


> -- this will hang
> p = 123
> s = read(p,'*a')
No, it only seems so.
This code will first try to read 123 bytes from stdin and then all of stdin.
Try typying control-d (or control-z) once or twice.
In summary, Lua does check whether the first argument to read is a file handle.
--lhf

AltStyle によって変換されたページ (->オリジナル) /