FileSystemWatcher vs polling to watch for file changes

后端 未结 13 2298
一个人的身影
一个人的身影 2020-11-22 05:44

I need to setup an application that watches for files being created in a directory, both locally or on a network drive.

Would the FileSystemWatcher or p

相关标签:
13条回答
  • 2020-11-22 06:16

    I would say use polling, especially in a TDD scenario, as it is much easier to mock/stub the presence of files or otherwise when the polling event is triggered than to rely on the more "uncontrolled" fsw event. + to that having worked on a number of apps which were plagued by fsw errors.

    0 讨论(0)
提交回复
热议问题