Monitoring files - how to know when a file is complete

前端 未结 9 1980
无人及你
无人及你 2021-01-11 12:59

We have several .NET applications that monitor a directory for new files, using FileSystemWatcher. The files are copied from another location, uploaded via FTP, etc. When th

9条回答
  •  醉梦人生
    2021-01-11 13:26

    The "Changed" event on the FileSystemWatcher should shouldn't fire until the file is closed. See my answer to a similar question. There is a possibility that the FTP download mechanism closes the file multiple times during download as new data comes in, but I would think that is a little unlikely.

提交回复
热议问题