Binary IO

Ross Paterson ross at
Thu Apr 21 07:07:15 EDT 2005

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.

More information about the Libraries mailing list