diff options
author | Joey Hess <joey@kitenet.net> | 2014-01-29 17:19:46 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-01-29 17:19:46 -0400 |
commit | 473d3f2ed5f60469f621fccbc823f7e301486f29 (patch) | |
tree | 51d25718a1ba5bbefd7be7c0f4818d312afa7de3 /Utility | |
parent | 66460ac0158b60fcba65fc68fa83d234cad9e318 (diff) |
tell moveFile to overwrite existing files
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/PosixFiles.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Utility/PosixFiles.hs b/Utility/PosixFiles.hs index 2c1a05a6a..23edc25c9 100644 --- a/Utility/PosixFiles.hs +++ b/Utility/PosixFiles.hs @@ -19,12 +19,15 @@ import System.PosixCompat.Files as X hiding (rename) #ifndef mingw32_HOST_OS import System.Posix.Files (rename) #else -import System.Win32.File (moveFile) +import qualified System.Win32.File as Win32 #endif {- System.PosixCompat.Files.rename on Windows calls renameFile, - - so cannot rename directories. Instead, use Win32 moveFile, which can. -} + - so cannot rename directories. + - + - Instead, use Win32 moveFile, which can. It needs to be told to overwrite + - any existing file. -} #ifdef mingw32_HOST_OS rename :: FilePath -> FilePath -> IO () -rename = moveFile +rename src dest = Win32.moveFileEx src dest Win32.mOVEFILE_REPLACE_EXISTING #endif |