summaryrefslogtreecommitdiff
path: root/testsuite/tests/lib/IO/openFile003.hs
blob: 81b69c40ec045980cfb27f2c2bc9ca561167480d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import System.IO
import System.IO.Error

-- !!! Open a directory (should fail)

main = do
  r <- tryIOError (openFile "." ReadMode)
  print r
  r <- tryIOError (openFile "." WriteMode)
  print r
  r <- tryIOError (openFile "." AppendMode)
  print r
  r <- tryIOError (openFile "." ReadWriteMode)
  print r