For example, FileSystemWatcher catches some change in the monitored directory.
Is it possible to distinguish the removal of files from moving, as well as in the second case to find out where the files are moved?
For example, FileSystemWatcher catches some change in the monitored directory.
Is it possible to distinguish the removal of files from moving, as well as in the second case to find out where the files are moved?
If you need to track the removal and movement of files within the monitored directory, then you need a couple of OnDeleted / OnCreated events.
If you need to track file movements from the monitored directory, then, alas, FileSystemWatcher does not support this. For him, any file transfer is deletion. And you can not distinguish it from the actual removal.
Fast google prompts that file system watcher can be used (via WinAPI). There is also a commercial library CallbackFilter , which apparently does everything for you.
Source: https://ru.stackoverflow.com/questions/621837/
All Articles