I have a fifo that I want to read lines from, but everything is blocking.

execute([ "mkfifo", filename ]);
File fifo = File(filename, "r");  // blocks already
immutable input = fifo.readln();  // blocks
foreach (line; fifo.byLineCopy) { /* blocks */ }

How can I go about doing this to get non-blocking reads? Or perhaps a way to test whether there is text waiting in the fifo? File.eof is not it.

if (fifo.hasData)
{
    immutable stuff = fifo.readln();
    // ...
}

Reply via email to