File is being used by another process

后端 未结 7 1241
野的像风
野的像风 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 22:04

    The problem is that the FileSystemWatcher tells you immediately when the file was created. It doesn't wait for the file to be released. For instance, when you copy a large file which takes 3 seconds to copy, so you have to open the file after that.

    http://www.codeproject.com/Questions/461666/FileSystemWatcher-issue-in-windows-application Wait until file is unlocked in .NET

    0 讨论(0)
提交回复
热议问题