Antivirus and file access conflict: good programming practice?

Sometimes we experiment with access denied errors due to an antivirus that processes the file at the same time that our program wants to write / rename / copy it.

This rarely happens, but it frustrates me because I donโ€™t find a good way to handle it: technically our answer is to change the source code to implement the kind of retry mechanism ... but we are not satisfied. that smells a bit ... we cannot afford to tell our customers "please turn off your antivirus, let our software work correctly" ...

So, if you have already experimented with such problems, let me know how you handled it.

Thanks!

+4
source share
1 answer

Actually there are very few possibilities for the expression "turn avs off". It just will not fly in many offices, so we did exactly what you said: build a queue of replays.

Files that are locked are added to the queue. When the initial operation ends, we stop for 1 second and sequentially exit through the queue. Files that are not executed the second time are added in the second turn, and after the first completion we wait 3 seconds and go through the second.

Files that do not perform the second turn (third attempt) are reported.

+3
source

Source: https://habr.com/ru/post/1277058/


All Articles