On 23/08/2010 12:57, Felipe Lessa wrote:
On Mon, Aug 23, 2010 at 8:51 AM, Simon Marlow<marlo...@gmail.com> wrote:
Hmm, RawIO.read looks ok:
-- | Read up to the specified number of bytes, returning the number
-- of bytes actually read. This function should only block if there
-- is no data available. If there is not enough data available,
-- then the function should just return the available data. A return
-- value of zero indicates that the end of the data stream (e.g. end
-- of file) has been reached.
that seems pretty clear to me. No?
It says that it "should only block if there is no data available". I
assumed that fillReadBuffer has the same semantics. If both do not
block if there is data, then hGetBuf would not wait for the buffer to
be filled, if I am reading its source correctly [1]. Either they do
block until the buffer is filled, or I'm misreading hGetBuf/bufRead.
=)
I think it's the latter. bufRead loops until it has read the full
amount of data requested, or EOF is reached.
Cheers,
Simon
[1]
http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/src/GHC-IO-Handle-Text.html#line-820
Cheers! =)
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe