[p2p-hackers] keeping metadata synchronized

Markus Kern markus-kern at gmx.net
Wed Sep 15 15:20:39 UTC 2004


On Wednesday, September 15, 2004, 4:51:57 PM Eric Hanson <eric at aquameta.com> wrote:

> That's kind of what I was thinking, but I don't even know where
> to start looking on how to do it.  It's going to be a Java app,
> so I can write a listener to listen for moves, deletes and
> renames and sync on that.  But, say on a OSX box, is there an
> event thrown that can be tapped into somehow?  How about
> Windows?  How about Linux?

On Windows there is ReadDirectoryChangesW [1] to monitor directory
trees for changes. How easy this would be to use in Java (especially
in asynchronous mode) I don't know.

There also seem to be issues with the time resolution this method
offers [2]. Apparently some events are only triggered once per hour
for performance reasons.

[1] http://msdn.microsoft.com/library/en-us/fileio/base/readdirectorychangesw.asp
[2] http://support.microsoft.com/default.aspx?scid=kb;EN-US;q245214




More information about the P2p-hackers mailing list