in reply to Re: Re: When is it safe to move a file?
in thread When is it safe to move a file?
Then, after you rename it, check to see if it's still changing, because it's possible that the remote process opened the file just before you renamed it.
There's still a race condition, but it's much smaller. Proper design would have been for the remote program to never send the same data twice and never use the same filename twice. I also recommend that you find the person who designed this broken protocol and kick them in the ass.
|
|---|