Hi,
if you're using ghc under Win32, this is expected behaviour
(and is there because of backwards compatibility with CP/M -
see http://support.microsoft.com/support/kb/articles/Q68/4/23.asp
for more info.)
The fix is to open your file in BinaryMode using
IOExts.openFileEx :: FilePath -> IOModeEx -> IO Handle
data IOModeEx = BinaryMode IOMode | TextMode IOMode
There's also
hSetBinaryMode :: Handle -> Bool -> IO Bool
to change the text/binary flag on the fly, but please notice
that this may interact unexpectedly with buffering.
--sigbjorn
[EMAIL PROTECTED] writes:
>
> i'd like to read a byte stream from stdin.
> the stream contains 0xFF now and then.
> i fear that such a byte is treated as EOF by ghc,
> because processing seems to stop right after it first occured.
> do you know a workaround?
>
> in case you're asking - i'm trying to implement the GMP (go
> modem protocol)
> ftp://ftp.nuri.net/Go/programs/protocol.Z
>
> any hints appreciated. PosixIO maybe?
> --
> -- Johannes Waldmann ----
> http://www.informatik.uni-leipzig.de/~joe/ --
> -- [EMAIL PROTECTED] -- phone/fax (+49) 341 9732
> 204/209 --
>
>
>