Re: Example of usage of DirSnapshot/DirSnapshotDiff?

95 views
Skip to first unread message

Raymond Bennett

unread,
Jan 12, 2012, 5:59:04 PM1/12/12
to watchdo...@googlegroups.com

Anybody have an example on how to use this. Basically I want to periodically write a DirSnapshot to disk, so that when my process starts up, it can take another DirSnapshot, compare the 2, and only have to process files/dirs which were 'possibly' modified.

Thanks

Laurent LAPORTE

unread,
May 19, 2013, 9:36:16 AM5/19/13
to watchdo...@googlegroups.com

Hi,


The DirSnapshot/DirSnapshotDiff mechanism is only used with the polling observer. This observer is chosed only when no platform specific observer is found! So, you need to write you own watcher (main application) and use the polling.PollingObserver class.


Currently, the DirSnapshotDiff is not serializable. You need to develop your own serialization model.


The PollingObserver use a PollingEmitter which is a daemon thread. You can override the start and stop methods to trigger the DirSnapshotDiff serialization.


------- Laurent.

Reply all
Reply to author
Forward
0 new messages