FileSystemWatcher.Error Event
Assembly: System (in system.dll)
The system notifies you of file changes, and it stores those changes in a buffer that the component creates and passes to the APIs. If there are many changes in a short time, the buffer can overflow. This causes the component to lose track of changes in the directory, and it will only provide blanket notification. Increasing the size of the buffer is expensive, as it comes from non paged memory that cannot be swapped out to disk, so keep the buffer as small as possible. To avoid a buffer overflow, use the NotifyFilter, Filter, and IncludeSubdirectories properties to filter out unwanted change notifications.
Note |
|---|
| Common file system operations might raise more than one event. For example, when a file is moved from one directory to another, several OnChanged and some OnCreated and OnDeleted events might be raised. Moving a file is a complex operation that consists of multiple simple operations, therefore raising multiple events. Likewise, some applications (for example, antivirus software) might cause additional file system events that are detected by FileSystemWatcher. |
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
"To avoid a buffer overflow, use the NotifyFilter, Filter, and IncludeSubdirectories properties to filter out unwanted change notifications."
This is not true as using Filter doesn't limit what goes into the Internal Buffer, it applies to notifications after they have gone through the buffer.
Besides NotifyFilter and IncludeSubdirectories you can use InternalBufferSize property of FileSystemWatcher to control buffer overflow.
- 2/8/2008
- kooriyoo
Note