From 933bc96e88506ef6f8953ee71b3b3c8d53e7eed5 Mon Sep 17 00:00:00 2001 From: "Malcolm.Wallace@cs.york.ac.uk" Date: Sat, 4 Aug 2007 09:28:15 +0000 Subject: [PATCH] Restore working version of copyFile for nhc98. The recent patch changing its implementation was insufficiently portable. --- System/Directory.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/System/Directory.hs b/System/Directory.hs index fcdb937..1f624a1 100644 --- a/System/Directory.hs +++ b/System/Directory.hs @@ -76,6 +76,7 @@ import Control.Exception #ifdef __NHC__ import Directory +import System (system) #endif /* __NHC__ */ #ifdef __HUGS__ @@ -513,6 +514,12 @@ copied to /new/, if possible. -} copyFile :: FilePath -> FilePath -> IO () +#ifdef __NHC__ +copyFile fromFPath toFPath = + do readFile fromFPath >>= writeFile toFPath + try (copyPermissions fromFPath toFPath) + return () +#else copyFile fromFPath toFPath = copy `catch` (\e -> case e of IOException e -> @@ -534,6 +541,7 @@ copyFile fromFPath toFPath = when (count > 0) $ do hPutBuf hTo buffer count copyContents hFrom hTo buffer +#endif -- | Given path referring to a file or directory, returns a -- canonicalized path, with the intent that two paths referring -- 1.7.10.4