Ok but my question is why you want to copy a file from a source to a destination if both locations are the same ?
Normally, you should get a popup that say that a file already exist and if you click on "replace", you will get an error that say that the file is used by another process