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

llvm-svn: 28157
This commit is contained in:
Jeff Cohen 2006-05-07 02:51:51 +00:00
parent dc94b738d0
commit 44ece070c7

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;