mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-25 15:46:04 +01:00
Merge pull request #973 from aaboyd/move-overwrite-on-windows
overwrite existing files on windows when moving files
This commit is contained in:
commit
c25d9f00e5
Foundation/src
@ -297,7 +297,7 @@ void FileImpl::renameToImpl(const std::string& path)
|
|||||||
{
|
{
|
||||||
poco_assert (!_path.empty());
|
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);
|
handleLastErrorImpl(_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,7 +305,7 @@ void FileImpl::renameToImpl(const std::string& path)
|
|||||||
|
|
||||||
std::wstring upath;
|
std::wstring upath;
|
||||||
UnicodeConverter::toUTF16(path, 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);
|
handleLastErrorImpl(_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user