Filesystem watcher and large files

后端 未结 5 462
感情败类
感情败类 2020-12-02 21:42
var fsw = new FileSystemWatcher(sPath, \"*.PPF\");
fsw.NotifyFilter = NotifyFilters.FileName;
fsw.IncludeSubdirectories = true;
fsw.Created += FswCreated;
fsw.Enable         


        
5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-02 22:03

    Simply in your fswCreated, sleep for about 1/2 seconds with Thread.Sleep(500) if thats possible. That should give you the time the computer needs to finish writing the file.

    Of course, for slower hard drives, this may or may enough time.

提交回复
热议问题