Monitoring files - how to know when a file is complete

前端 未结 9 2070
无人及你
无人及你 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:24

    The way I check in Windows if a file has been completely uploaded by ftp is to try to rename it. If renaming fails, the file isn't complete. Not very elegant, I admit, but it works.

提交回复
热议问题