1 --!!! Testing IO.hFileSize
2 module Main(main) where
5 import Directory ( removeFile )
8 sz <- hFileSize stdin `catch` (\ _ -> return (-1))
11 hdl <- openFile fn WriteMode
13 hPutStrLn hdl "file_size"
14 -- with default buffering
18 hSetBuffering hdl NoBuffering
19 hPutStrLn hdl "file_size"
23 hSetBuffering hdl LineBuffering
24 hPutStrLn hdl "file_size"
25 -- with line buffering
28 hSetBuffering hdl (BlockBuffering (Just 4))
29 -- with block buffering
30 hPutStrLn hdl "file_size"