Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Delphi: WinAPI и системное программирование > Отслеживать изменение множества файлов


Автор: CatATonik 7.2.2007, 17:52
Необходимо отслеживать изменение файлов (файлов может быть много), появление, удаление файлов в папке. 
FindFirstChangeNotification работает только для операций сделаных в проводнике (или через функции shell). Как отследить если, например, файл удалили в Total Commander или подобной программе?
Например, Sysinternals FileMon очень шустро выдает все операции на диске, как вы думаете как это сделано?

Автор: Yanis 7.2.2007, 18:07
По моему в RegMon используется драйвер. Наверняка FileMon тоже в таком же русле написан.

Добавлено @ 18:11 
Цитата с родной странички:
Цитата
How FileMon Works
For the Windows 9x driver, the heart of FileMon is in the virtual device driver, Filevxd.vxd. It is dynamically loaded, and in its initialization it installs a file system filter via the VxD service, IFSMGR_InstallFileSystemApiHook, to insert itself onto the call chain of all file system requests. On Windows NT the heart of FileMon is a file system driver that creates and attaches filter device objects to target file system device objects so that FileMon will see all IRPs and FastIO requests directed at drives. When FileMon sees an open, create or close call, it updates an internal hash table that serves as the mapping between internal file handles and file path names. Whenever it sees calls that are handle based, it looks up the handle in the hash table to obtain the full name for display. If a handle-based access references a file opened before FileMon started, FileMon will fail to find the mapping in its hash table and will simply present the handle's value instead. 

Information on accesses is dumped into an ASCII buffer that is periodically copied up to the GUI for it to print in its listbox.

Автор: dumb 8.2.2007, 05:05
Цитата(CatATonik @  7.2.2007,  17:52 Найти цитируемый пост)
FindFirstChangeNotification работает только для операций сделаных в проводнике (или через функции shell).

нет.
именно оно и поможет в вопросе топика.

Автор: MetalFan 8.2.2007, 09:43
CatATonik, показывай, как используешь. 
в MSDN есть хороший пример на С.

Автор: CatATonik 8.2.2007, 10:33
Пока никак не использую, использовал раньше, по воспоминаниям работало именно так как я написал. Будет время попробую,  сообщу о результатах.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)