How to manually Lock a file for other applications
问题 I have spent quite some time figuring out how to do this but did not find any usefull solution. Here is what I want to do. I am generating a huge binary file in my application. The tricky thing is that, the process requires me to occasionally close the FileStream. The problem now is, that occasionally other applications (i.e. my virus scanner) are using this brief moment where the file is not locked anymore, to lock the file itself. or other applications like dropbox etc... The result is,