1 -- !!! Testing IO.hFileSize
2 module Main(main) where
5 import Directory ( removeFile, doesFileExist )
9 sz <- hFileSize stdin `catch` (\ _ -> return (-1))
13 when f (removeFile fn)
14 hdl <- openFile fn WriteMode
15 hPutStr hdl "file_size"
16 -- with default buffering
20 hSetBuffering hdl NoBuffering
21 hPutStr hdl "file_size"
25 hSetBuffering hdl LineBuffering
26 hPutStr hdl "file_size"
27 -- with line buffering
30 hSetBuffering hdl (BlockBuffering (Just 4))
31 -- with block buffering
32 hPutStr hdl "file_size"