Skip to content

Commit

Permalink
MSVC: Fix MoveFile error when destination exists
Browse files Browse the repository at this point in the history
Use CopyFile with overwrite flag instead
  • Loading branch information
lephilousophe committed Sep 25, 2019
1 parent f4638bb commit d09d6c7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions devtools/create_project/scripts/revision.vbs
Expand Up @@ -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

0 comments on commit d09d6c7

Please sign in to comment.