C# FileSystemWatcher Serious Problem?

前端 未结 4 1253
清歌不尽
清歌不尽 2021-01-21 03:42

I have implemented a FileSystemWatcher for a folder which resides on a NetworkStorage Device (having no O.S.).

The scenario is, we have two machine say

4条回答
  •  渐次进展
    2021-01-21 04:06

    We built a product for a company where a Windows service running on a server was monitoring a folder and when files were added to this folder, the files were read, processed (in this case, created a barcode layout and printed on a barcode printer) and then deleted.

    Everything worked perfectly for a number of customers with pretty good performance until we came across a customer where it only worked sometimes. There were especially problems when many files were added to the folder at once.

    The problem were that the folder that we were watching was in a share on a samba filesystem and FileSystemWatcher does not work reliably on samba file system shares (Google for "FileSystemwatcher samba"). Since you are talking about a "NetworkStorage Device", I guess that you mean that it is a NAS, and NAS quite often use a Linux/Unix OS under the hoods and expose share using samba.

    Our solution were to add a feature to our software so that it could be configured to use polling when needed.

提交回复
热议问题