You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
}
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.