I am doing a simple thing with files on network shared folder, within Windows:
CreteFile (new file)
DeleteFile (old file)
MoveFile (from new file name to old)
This works for most files in the shared folder, but for two I get error "File already exists" on MoveFile command. What is happening here? I tried googling for clues, but didn't find anything so far. I do this in C#, but this shouldn't matter.
Network folder is part of the web site. But even if I restart IIS the problem persists, with the same two files.
Also, overwriting the files directly still works. In fact that was the previous solution, and I wanted to improve on it, because files may become corrupted if the copy operation fails in the middle of the copying.