[Haskell-cafe] Fwd: Default stdout buffering of child processof createProcess

Donn Cave donn at avvanta.com
Sat Aug 2 07:54:47 UTC 2014


quoth Elliot Robinson <elliot.robinson at argiopetech.com>,

>    As a quick usage/rationale overview, I
> feed an attoparsec parser by repeatedly calling receive (intermixed with
> some intelligent use of `transmit` to deal with messages and other
> incomplete screen updates) until I receive a valid map. `hGetNonBlocking`
> bypasses the standard buffering mechanisms and returns whatever is in the
> PTY buffer (which may be nothing) rather than waiting for the specified
> line/block/whatever buffer to fill.

If you don't really want non-blocking I/O (i.e., normally returns 0 bytes),
System.Posix.IO.ByteString.fdRead is a blocking read that returns available
unbuffered data.  Handles are for buffered I/O.

	Donn


More information about the Haskell-Cafe mailing list