Browse Source

core: do not fail when target file already exists

Daniele Bartolini 1 year ago
parent
commit
7a6c700514
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/core/os.cpp

+ 1 - 1
src/core/os.cpp

@@ -323,7 +323,7 @@ namespace os
 	{
 		RenameResult rr;
 #if CROWN_PLATFORM_WINDOWS
-		if (MoveFile(old_name, new_name) != 0)
+		if (MoveFileEx(old_name, new_name, MOVEFILE_REPLACE_EXISTING) != 0)
 			rr.error = RenameResult::SUCCESS;
 		else
 			rr.error = RenameResult::UNKNOWN;