-
Notifications
You must be signed in to change notification settings - Fork 190
Closed
Labels
available on masterFix is done on master branch, issue closed on next releaseFix is done on master branch, issue closed on next releasebugSomething isn't workingSomething isn't working
Milestone
Description
Currently , fs::rename() will return with error 183, if destination file already exists. The standard indicate that it must overwrite file , here is the patch to use MoveFileExW instead.
GHC_INLINE void rename(const path& from, const path& to, std::error_code& ec) noexcept
{
ec.clear();
#ifdef GHC_OS_WINDOWS
if (from != to) {
if (!MoveFileExW(detail::fromUtf8<std::wstring>(from.u8string()).c_str(), detail::fromUtf8<std::wstring>(to.u8string()).c_str(), (DWORD) MOVEFILE_REPLACE_EXISTING)) {
ec = detail::make_system_error();
}
}
#else
if (from != to) {
if (::rename(from.c_str(), to.c_str()) != 0) {
ec = detail::make_system_error();
}
}
#endif
}
Metadata
Metadata
Assignees
Labels
available on masterFix is done on master branch, issue closed on next releaseFix is done on master branch, issue closed on next releasebugSomething isn't workingSomething isn't working