I am working on a C# program that needs to use the FileSystemWatcher
class so it will be notified when new files are created. As part of the initialization, the program scans the directory so it can process any files that already exist in it. This is all working fine.
However, in a discussion with another developer, we started questioning whether this will always work. Are there conditions under which the FileSystemWatcher
will miss the creation of files? If so, what are these conditions?
In order to handle this scenario, we would just run the code in our initialization process that scans the directory periodically, but how likely is it for the FileSystemWatcher
to miss files?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…