Unlike Unix, Windows won't let a file be implicitly replaced via renaming without...
authorJeff Cohen <jeffc@jolt-lang.org>
Sun, 7 May 2006 02:51:51 +0000 (02:51 +0000)
committerJeff Cohen <jeffc@jolt-lang.org>
Sun, 7 May 2006 02:51:51 +0000 (02:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28157 91177308-0d34-0410-b5e6-96231b3b80d8

lib/System/Win32/Path.inc

index 8f3ceebb28b0b9b550f4b22ca53cd441e86b265e..27baf827566054e93731178d8d42b3d52e3fa7a9 100644 (file)
@@ -682,7 +682,7 @@ bool Path::getMagicNumber(std::string& Magic, unsigned len) const {
 
 bool
 Path::renamePathOnDisk(const Path& newName) {
-  if (!MoveFile(path.c_str(), newName.c_str()))
+  if (!MoveFileEx(path.c_str(), newName.c_str(), MOVEFILE_REPLACE_EXISTING))
     ThrowError("Can't move '" + path +
                "' to '" + newName.path + "': ");
   return true;