views:

179

answers:

1

Sometimes, we experiment "access denied" errors due to the antivirus which handles the file at the same time our program wants to write/rename/copy it.

This happens rarely but makes me upset because I don't find the good way to deal with: technically our response is to change our source code to implement kind of retry mechanism... but we are not satisfied.. . that smells a little bit... we can't afford telling our customers "please turn off your antivirus, let our software work properly"...

So if your have already experimented such issues, please let me know how you dealt with.

Thanks!

+3  A: 

There is really very little scope for saying "turn avs off". That just won't fly in a lot of offices so we've done exactly what you've said: build a retry-queue.

Files that are locked are added to the queue. When the original operation ends, we pause for 1 second and sequentially pop through the queue. Files that fail the second time are added to a second queue and after the first completes, we wait 3 seconds and pop through the second.

Files that fail the second queue (the third attempt) are reported.

Oli