How to test if a file is fully copied in .NET

后端 未结 9 1270
小鲜肉
小鲜肉 2021-01-17 12:27

I am monitoring a folder for new files and need to process them. The problem is that occasionally file opening fails, because system has not finished copying it.

Wha

9条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-17 12:31

    You should also cover cases like: file is in use by other program, file was deleted (copy didn't succeed) etc..

    Use an extended exception handling to cover all important cases that might occur.

提交回复
热议问题