mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-04 17:29:11 +00:00
MSVC: Fix MoveFile error when destination exists
Use CopyFile with overwrite flag instead
This commit is contained in:
parent
66b8beede8
commit
c893c5a60b
@ -492,11 +492,10 @@ Sub CompareFileAndReplace(src_filename, dst_filename)
|
||||
Set file = FSO.OpenTextFile(dst_filename, 1, 0, 0)
|
||||
dst_data = file.ReadAll
|
||||
file.Close
|
||||
If StrComp(src_data, dst_data, vbBinaryCompare) = 0 Then
|
||||
' Files are the same, just remove the source
|
||||
FSO.DeleteFile src_filename
|
||||
Else
|
||||
If StrComp(src_data, dst_data, vbBinaryCompare) <> 0 Then
|
||||
' Files are different, overwrite the destination
|
||||
FSO.MoveFile src_filename, dst_filename
|
||||
FSO.CopyFile src_filename, dst_filename, True
|
||||
End If
|
||||
' Remove temporary source
|
||||
FSO.DeleteFile src_filename
|
||||
End Sub
|
||||
|
Loading…
x
Reference in New Issue
Block a user