overwrite existing files on windows when moving files

This commit is contained in:
Alex Boyd 2015-10-09 00:48:23 -04:00
parent e438061ce7
commit 7ef3c2e44c
2 changed files with 2 additions and 2 deletions

View File

@ -297,7 +297,7 @@ void FileImpl::renameToImpl(const std::string& path)
{
poco_assert (!_path.empty());
if (MoveFileA(_path.c_str(), path.c_str()) == 0)
if (MoveFileExA(_path.c_str(), path.c_str(), MOVEFILE_REPLACE_EXISTING) == 0)
handleLastErrorImpl(_path);
}

View File

@ -305,7 +305,7 @@ void FileImpl::renameToImpl(const std::string& path)
std::wstring upath;
UnicodeConverter::toUTF16(path, upath);
if (MoveFileW(_upath.c_str(), upath.c_str()) == 0)
if (MoveFileExW(_upath.c_str(), upath.c_str(), MOVEFILE_REPLACE_EXISTING) == 0)
handleLastErrorImpl(_path);
}