blob: 63cfea1a876718dfde5f17c4038b5cf6cb307c0e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-- !!! opening a file in WriteMode better truncate it
import System.IO
main = do
h <- openFile "openFile006.out" AppendMode
hPutStr h "hello, world"
size <- hFileSize h
print size
hClose h
h <- openFile "openFile006.out" WriteMode
size <- hFileSize h
print size
|