23 May
2005
23 May
'05
4:32 p.m.
On 24/05/2005, at 2:03 AM, Andre Pang wrote:
Hi all, I have the following snippet of code:
mutableMemoryArray <- newArray_ (0, bufferSize - 1) bytesRead <- hGetArray handle mutableMemoryArray bufferSize
The problem is that hGetArray (like hGetBuf) may read less than the amount that you specify (since you may hit EOF before filling up the whole array). [..] Am I missing something obvious here?
Oops, never mind, I completely forgot that hPutArray also takes in a 'count' parameter, and that the array bounds simply reflects its size rather than how many elements of it are present. Thanks to Lemmih for bringing this to my attention on #haskell! -- % Andre Pang : trust.in.love.to.save <http://www.algorithm.com.au/>