From 09e058228206fe019de796d2098dd3843d347f04 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Sun, 5 Nov 2017 20:57:34 -1000 Subject: [PATCH] Use MoveFileEx for Win32 file renaming --- include/kabufuda/Util.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/kabufuda/Util.hpp b/include/kabufuda/Util.hpp index 0565aeb..8cfeb1b 100644 --- a/include/kabufuda/Util.hpp +++ b/include/kabufuda/Util.hpp @@ -319,7 +319,7 @@ static inline int Rename(const SystemChar* oldpath, const SystemChar* newpath) { #if CARD_UCS2 //return _wrename(oldpath, newpath); - return ReplaceFileW(newpath, oldpath, nullptr, 0, nullptr, nullptr) == 0; + return MoveFileExW(oldpath, newpath, MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH) == 0; #else return rename(oldpath, newpath); #endif