[Haskell-cafe] (no subject)

L.Guo leaveye.guo at gmail.com
Thu May 24 03:24:29 EDT 2007


Sorry for not familiar to the email client.

My system is WinXP, and using GHC 6.6.
And is read from file.
Data is truncated at the ^Z char.

I just wrote one simple test code.

> import IO
> 
> writeTest fn = do
>   h <- openFile fn WriteMode
>   mapM_ (\p -> hPutChar h (toEnum p::Char)) $ [0..255] ++ [0..255]
>   hClose h
> 
> accessTest fn = do
>   h <- openFile fn ReadMode
>   s <- hGetContents h
>   putStrLn . show . map fromEnum $ s
>   hClose h
> 
> main = do
>   writeTest "ttt"
>   accessTest "ttt"




More information about the Haskell-Cafe mailing list