Skip to content

Commit

Permalink
Use MoveFileEx for Win32 file renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
jackoalan committed Nov 6, 2017
1 parent 3cf7aee commit 09e0582
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/kabufuda/Util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 09e0582

Please sign in to comment.