Fix these tests
[haskell-directory.git] / tests / copyFile001.hs
1
2 module Main (main) where
3
4 import Control.Exception
5 import Data.List
6 import System.Directory
7 import System.IO
8
9 main :: IO ()
10 main = do tryIO $ removeFile to
11           cs_before <- getDirectoryContents "copyFile"
12           putStrLn "Before:"
13           print $ sort cs_before
14           copyFile from to
15           cs_before <- getDirectoryContents "copyFile"
16           putStrLn "After:"
17           print $ sort cs_before
18           readFile to >>= print
19
20 tryIO :: IO a -> IO (Either IOException a)
21 tryIO = try 
22
23 from, to :: FilePath
24 from = "copyFile/source"
25 to   = "copyFile/target"
26