FileSystemWatcher
От: bambor  
Дата: 16.05.08 17:52
Оценка:
Как я понимаю, данный класс использует winapi ф-цию Readdirectorychanges
далее суть проблемы
класс вызывает обработчики удаления файла в каталоге из которого переносят и изменение каталога в который переносятся при перемещении(cut/paste) файлов и одного подкаталога в другой. Переименование файла в пределах одного подкаталога обрабатывается корректно.
еще много оповещений пропадает при групповых операциях копирования/удаления
такое впечатление, что события не буфферизируются систеой и если поток, ожидающий события не стоит в ожидании WaitForChanges, то события уходят в пустоту
Подскажите плз в чем могут быть грабли по обоим вопросам
Re: FileSystemWatcher
От: Овощ http://www.google.com
Дата: 17.05.08 07:52
Оценка: +1
FileSystemWatcher Class

The Windows operating system notifies your component of file changes in a buffer created by the FileSystemWatcher. 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 with the InternalBufferSize property is expensive, as it comes from non-paged memory that cannot be swapped out to disk, so keep the buffer as small yet large enough to not miss any file change events. To avoid a buffer overflow, use the NotifyFilter and IncludeSubdirectories properties so you can filter out unwanted change notifications.
...
Note that a FileSystemWatcher does not raise an Error event when an event is missed or when the buffer size is exceeded, due to dependencies with the Windows operating system. To keep from missing events, follow these guidelines:
* Increasing the buffer size with the InternalBufferSize property can prevent missing file system change events.
* Avoid watching files with long file names. Consider renaming using shorter names.
* Keep your event handling code as short as possible.

Re[2]: FileSystemWatcher
От: bambor  
Дата: 18.05.08 04:40
Оценка:
Здравствуйте, Овощ, Вы писали:

О>FileSystemWatcher Class


О>

О>The Windows operating system notifies your component of file changes in a buffer created by the FileSystemWatcher. 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 with the InternalBufferSize property is expensive, as it comes from non-paged memory that cannot be swapped out to disk, so keep the buffer as small yet large enough to not miss any file change events. To avoid a buffer overflow, use the NotifyFilter and IncludeSubdirectories properties so you can filter out unwanted change notifications.
О>...
О>Note that a FileSystemWatcher does not raise an Error event when an event is missed or when the buffer size is exceeded, due to dependencies with the Windows operating system. To keep from missing events, follow these guidelines:
О>* Increasing the buffer size with the InternalBufferSize property can prevent missing file system change events.
О>* Avoid watching files with long file names. Consider renaming using shorter names.
О>* Keep your event handling code as short as possible.


спасибо, но, вторая проблема, с определением переноса файло из одного подкаталога в другой осталась
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.