Allow filepath-1.2.*
[haskell-directory.git] / tests / copyFile001.hs
index 219b01b..0a59af2 100644 (file)
@@ -7,17 +7,20 @@ import System.Directory
 import System.IO
 
 main :: IO ()
-main = do try $ removeFile to
-          cs_before <- getDirectoryContents "copyFile"
+main = do tryIO $ removeFile to
+          cs_before <- getDirectoryContents "copyFile001dir"
           putStrLn "Before:"
           print $ sort cs_before
           copyFile from to
-          cs_before <- getDirectoryContents "copyFile"
+          cs_before <- getDirectoryContents "copyFile001dir"
           putStrLn "After:"
           print $ sort cs_before
           readFile to >>= print
 
+tryIO :: IO a -> IO (Either IOException a)
+tryIO = try
+
 from, to :: FilePath
-from = "copyFile/source"
-to   = "copyFile/target"
+from = "copyFile001dir/source"
+to   = "copyFile001dir/target"