[Haskell-beginners] Named Pipes Et Cetera
Magnus Therning
magnus at therning.org
Tue Nov 23 09:14:41 EST 2010
On Tue, Nov 23, 2010 at 12:55, matthew coolbeth <mac01021 at engr.uconn.edu> wrote:
> Hello, all.
>
> Three questions:
>
> 1> What, if anything, can I do in a Haskell program to do blocking
> reads from a Linux FIFO? For the curious, there is a small program
> below that doesn't block, but immediately terminates because of an EOF
>
> 2> How could I have found the answer to this question on my own? (The
> documentation that Google found for me was not completely adequate)
>
> 3> Is this sort of question generally regarded as too unixy or not
> haskelly enough to be appropriate for this mailing list?
The behaviour is as expected from reading the documentation on
hGetLine (http://hackage.haskell.org/packages/archive/haskell98/latest/doc/html/IO.html#v:hGetLine).
The same seems to be true for all functions in IO, so I suspect
you'll have to go down to a lower level where you have more control
over this behaviour, e.g. by using th fd* functions in
System.Posix.IO.
/M
--
Magnus Therning OpenPGP: 0xAB4DFBA4
email: magnus at therning.org jabber: magnus at therning.org
twitter: magthe http://therning.org/magnus
More information about the Beginners
mailing list