Watcher prototype » History » Version 5
Greg Burri, 08/03/2009 09:02 AM
| 1 | 1 | Greg Burri | h1. Watcher prototype |
|---|---|---|---|
| 2 | |||
| 3 | 2 | Greg Burri | The cache file structure store all the hashes of the shared files. If a file is added or removed from a shared directory (or a subfolder) it should be added or removed from the cache. |
| 4 | |||
| 5 | As far as I know there is no way to watch changes recursively of a folder tree. The QT class _QFileSystemWatcher_ cannot watch recursively. |
||
| 6 | |||
| 7 | The only way to synchronize is to periodically scan all the shared data and compare to the cached one. It can be a bit CPU consumer so it should be done with a low priority thread and maybe with a pause between each file hashing. |
||
| 8 | 3 | Greg Burri | |
| 9 | h2. famd |
||
| 10 | |||
| 11 | 4 | Greg Burri | On Linux it exists a file monitor named _famd_ ... maybe it can be a solution for the Linux based platforms. |
| 12 | 5 | Greg Burri | |
| 13 | h2. FindFirstChangeNotification |
||
| 14 | |||
| 15 | On Windows a directory and its subtree can be watched, see : http://msdn.microsoft.com/en-us/library/aa365261%28VS.85%29.aspx |