1 -- !!! check that we don't truncate files if the open fails
6 tmp = "openFile007.out"
9 h <- openFile tmp WriteMode
10 hPutStrLn h "hello, world"
12 -- second open in write mode better fail, but better not truncate the file
13 try (openFile tmp WriteMode) >>= print
16 s <- readFile tmp -- make sure our "hello, world" is still there