blob: d7ee78d637db48721bb40ba1067352a4b6ccc2ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
import System.IO
file = "readwrite003.txt"
main = do
writeFile file "ab\ncd\nef\ngh"
h <- openFile file ReadWriteMode
hGetLine h
hPutStrLn h "yz"
hClose h
h <- openBinaryFile file ReadMode
hGetContents h >>= putStr
|