lua-users home
lua-l archive

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


Am 05.10.2013 09:13 schröbte Jose Torre-Bueno:

On Oct 4, 2013, at 11:57 PM, Jose Torre-Bueno <jtorrebueno@cox.net> wrote:

Related to my earlier question about FIFOs, is there a way to open a file for non-blocking reads out of basic Lua.  That is with io.open?

No, not with `io.open`. You need some OS-specific module for that.


My earlier question seems to have fallen in the bit bucket.  It was is there any way to tell whether a named fifo has data in it before reading it since if the fifo is empty the read will block until another process puts something into the fifo.


With `luaposix` you could use `fileno` and `rpoll`. `posix.open` can also open a file in non-blocking mode.

HTH,
Philipp