File is being used by another process

后端 未结 7 1327
野的像风
野的像风 2021-01-11 21:08

I have a program that roughly does this:

  1. open a file to read from it.
  2. close the file
  3. Start a filewatcher to watch for changes in the file.
7条回答
  •  北恋
    北恋 (楼主)
    2021-01-11 21:42

    Beside other answers it is possible that when FileWatcher reacts file it not yet closed by that app. In step 1 try not to fail immediately but try several attempts with small delay.

提交回复
热议问题