summaryrefslogtreecommitdiff
path: root/libraries/base/tests/IO/openFile003.hs
blob: f3c640f2956cbd7ee249b3168edb9ff78fc5a093 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import System.Directory
import System.IO
import System.IO.Error

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

main = do
  let dir = "openFile003Dir"
  createDirectoryIfMissing False dir
  r <- tryIOError (openFile dir ReadMode)
  print r
  r <- tryIOError (openFile dir WriteMode)
  print r
  r <- tryIOError (openFile dir AppendMode)
  print r
  r <- tryIOError (openFile dir ReadWriteMode)
  print r