The Infamous “Multiple Events” Problem in FileSystemWatcher Class
Posted by Logu Krishnan | Posted in Uncategorized | Posted on 02-11-2005
0
Whoever, tries the FileSystemWatcher Class for first time, immedietly starts complaining about multiple event notifications and after a brief moment complains, that .NET is buggy and concludes that as a bug. Had heard this many times, and again recently came up with this issue…
Actually, the real root cause of this problem is the File System, NTFS. for e.g.: when a file modification operation occurs NTFS gives out 2 notifications,
Notification 1 : for Data Stream
Notification 2 : for Metadata
Hence 2 Notifications… Poor FSW Class, just handles this and does it’s job properly. Only possible way is to ignore the 2nd Notification.
else, we can use WMI and specify the polling interval, which should read something like the below,
“SELECT * FROM __InstanceModificationEvent WITHIN 10 …..”
Absolutely, nothing wrong in .NET…
No related posts.





