[Sorry if you are receiving this message for the second time] Hello there. I used the code below to read and print the bitmap file attached (bitmap.bmp), which cointains the character ASCII 26 (or 1A-hexa), that is used as an end of file marker in MS-DOS: import IO import IOExts main :: IO () main = do bmFile <- openFileEx "bitmap.bmp" (BinaryMode ReadMode) charloop bmFile 0 charloop :: Handle -> Integer -> IO () charloop bmFile 70 = hClose bmFile charloop bmFile n = do hSeek bmFile AbsoluteSeek n a <- hGetChar bmFile putStrLn [a] charloop bmFile (n+1) This program did not stuck at the special character ASCII 26, but if you change putStrLn by putStr, a strange thing will happen: after reading the ASCII 26 char, the program won't show characters anymore. Does anyone know why this happens? Thanks, Andre Furtado
participants (1)
-
Andre W B Furtado