I am working on a C # program that should use a class FileSystemWatcher, so it will be notified when new files are created. As part of the initialization, the program scans the directory so that it can process any files that already exist in it. It all works fine.
FileSystemWatcher
However, during a discussion with another developer, we started asking the question whether this will always work. Are there conditions under which FileSystemWatcherskipping file creation? If so, what are these conditions?
To deal with this scenario, we simply run the code in our initialization process, which periodically scans the directory, but how likely is it to FileSystemWatcherskip files?
FileSystemWatcherusually does not skip files. But:
ReadDirectoryChangesW
Other traps:
Moved
Deleted
Created
SOMETH~1.TXT
Something.txt
Changed
FileSystemWatcher - , , , .
fs- , , FSwatcher ( ), , - - "gigs", , , -, , . fswatcher , , FSwatcher . , , , , , . , FSwatcher, . , , Windows -. , - filestream, , , , , , , , , . , , - , , , 5 , , , bg , , , (, , ).
FSwatcher, , , , , . , , , , , , ! , , , :)