[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / misc / examples / io / io011 / Main.hs
diff --git a/ghc/misc/examples/io/io011/Main.hs b/ghc/misc/examples/io/io011/Main.hs
new file mode 100644 (file)
index 0000000..2fcbce5
--- /dev/null
@@ -0,0 +1,15 @@
+import LibDirectory
+
+main =
+    createDirectory "foo" >>
+    openFile "foo/bar" WriteMode >>= \ h ->
+    hPutStr h "Okay\n" >>
+    hClose h >>
+    renameFile "foo/bar" "foo/baz" >>
+    renameDirectory "foo" "bar" >>
+    openFile "bar/baz" ReadMode >>= \ h ->
+    hGetContents h >>= \ stuff ->
+    putStr stuff >>
+    hClose h >>
+    removeFile "bar/baz" >>
+    removeDirectory "bar"