FileSystemWatcher - is File ready to use

后端 未结 6 1097
[愿得一人]
[愿得一人] 2020-12-03 17:45

When a file is being copied to the file watcher folder, how can I identify whether the file is completely copied and ready to use? Because I am getting multiple events duri

6条回答
  •  悲哀的现实
    2020-12-03 18:42

    One possible solution (It worked in my case) is to use the Change event. You can log in the create event the name of the file just created and then catch the change event and verify if the file was just created. When I manipulated the file in the change event it didn't throw me the error "File is in use"

提交回复
热议问题