X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=System%2FDirectory.hs;h=42ed6afe51c88e85171a9ef3763c419ee7815c6a;hb=e5bc07906c3690afa056029f94e6aae5ef4dbaa6;hp=e7affb68f03a1a7f85c8ce182f469a89f0e6432f;hpb=b33cc8f0d60e7ab53a916bff339ff40a677e0a62;p=haskell-directory.git diff --git a/System/Directory.hs b/System/Directory.hs index e7affb6..42ed6af 100644 --- a/System/Directory.hs +++ b/System/Directory.hs @@ -70,6 +70,7 @@ import Prelude hiding ( catch ) import System.Environment ( getEnv ) import System.FilePath +import System.IO import System.IO.Error hiding ( catch, try ) import Control.Monad ( when, unless ) import Control.Exception @@ -92,7 +93,6 @@ import Foreign.C import System.Posix.Types import System.Posix.Internals import System.Time ( ClockTime(..) ) -import System.IO import GHC.IOBase ( IOException(..), IOErrorType(..), ioException ) @@ -101,7 +101,7 @@ A directory contains a series of entries, each of which is a named reference to a file system object (file, directory etc.). Some entries may be hidden, inaccessible, or have some administrative function (e.g. `.' or `..' under POSIX -), but in +), but in this standard all such entries are considered to form part of the directory contents. Entries in sub-directories are not, however, considered to form part of the directory contents. @@ -553,7 +553,7 @@ copyFile fromFPath toFPath = bracketOnError openTmp cleanTmp $ \(tmpFPath, hTmp) -> do allocaBytes bufferSize $ copyContents hFrom hTmp hClose hTmp - try (copyPermissions fromFPath toFPath) + try (copyPermissions fromFPath tmpFPath) renameFile tmpFPath toFPath openTmp = openBinaryTempFile (takeDirectory toFPath) ".copyFile.tmp" cleanTmp (tmpFPath, hTmp) = do try $ hClose hTmp