Binary IO

Simon Marlow simonmar at microsoft.com
Thu Apr 21 08:39:18 EDT 2005


On 21 April 2005 12:07, Ross Paterson wrote:

> On Thu, Apr 21, 2005 at 10:32:59AM +0100, Simon Marlow wrote:
>> In GHC, you can assume that
>> 
>>   hGetByte h = do c <- hGetChar h; return (fromIntegral (ord c))
>> 
>> you must open the file in binary mode (openBinaryFile).  I don't
>> think this works with Hugs, though.
> 
> It does, provided the file was opened in binary mode.

Right, thanks for the clarification.

Simon


More information about the Libraries mailing list