Unlike Unix, Windows won't let a file be implicitly replaced via renaming without explicit permission.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28157 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jeff Cohen 2006-05-07 02:51:51 +00:00
parent 77f361f5b3
commit e564de2d37

View 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;