summaryrefslogtreecommitdiff
path: root/testsuite/tests/lib/IO/hClose001.hs
blob: 8d31447e95eecdf34bb89f9c626714701e8cc7ae (plain)
1
2
3
4
5
6
7
8
import System.IO
import System.IO.Error

main = do
  h <- openFile "hClose001.tmp" WriteMode
  hPutStr h "junk" 
  hClose h
  hPutStr h "junk" `catchIOError` \ err -> if isIllegalOperation err then putStr "Okay\n" else error "Not okay\n"