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
import System.Posix.Types
import System.Posix.Internals
import System.Time ( ClockTime(..) )
-import System.IO
import GHC.IOBase ( IOException(..), IOErrorType(..), ioException )
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
-<http://www.opengroup.org/onlinepubs/007904975/toc.htm>), but in
+<http://www.opengroup.org/onlinepubs/009695399/>), 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.
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