[project @ 2004-07-30 23:29:41 by ross]
[haskell-directory.git] / System / Directory.hs
index 58d443c..7d92473 100644 (file)
@@ -28,6 +28,9 @@ module System.Directory
     -- * Actions on files
     , removeFile               -- :: FilePath -> IO ()
     , renameFile                -- :: FilePath -> FilePath -> IO ()
+#ifdef __GLASGOW_HASKELL__
+    , copyFile                  -- :: FilePath -> FilePath -> IO ()
+#endif
 
     -- * Existence tests
     , doesFileExist            -- :: FilePath -> IO Bool
@@ -434,7 +437,7 @@ If the /new/ file already exists, it is atomically replaced by the /old/ file.
 Neither path may refer to an existing directory.
 -}
 copyFile :: FilePath -> FilePath -> IO ()
-copyFile fromFPath toFPath = handle (changeFunName) $
+copyFile fromFPath toFPath =
        (bracket (openBinaryFile fromFPath ReadMode) hClose $ \hFrom ->
         bracket (openBinaryFile toFPath WriteMode) hClose $ \hTo ->
         allocaBytes bufferSize $ \buffer ->
@@ -443,7 +446,6 @@ copyFile fromFPath toFPath = handle (changeFunName) $
                bufferSize = 1024
                
                changeFunName (IOError h iot fun str mb_fp) = IOError h iot "copyFile" str mb_fp
-               changeFunName e                             = e
                
                copyContents hFrom hTo buffer = do
                        count <- hGetBuf hFrom buffer bufferSize