[p2p-hackers] keeping metadata synchronized

Eric Hanson eric at aquameta.com
Wed Sep 15 16:08:53 UTC 2004


Markus Kern (markus-kern at gmx.net) 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.

I'm thinking more of going the other way, writing something in C
that calls the Java daemon upon the event of a move delete or
rename.

So using ReadDirectoryChangesW would rely on a polling
mechanism?  This isn't going to work for my uses because... ok
let me explain a bit.

The idea -- and at this point it's just an idea -- is to create
an application level filesystem metadata layer.  Basically
implement something that will behave like WinFS in that you can
associate arbitrary XML metadata with any file on the
filesystem.

Except do it in Java using a Java XML database, so the whole
thing can be cross platform and provide a standard API.

The hard part is the integration with each filesystem it hopes
to run on -- the synchronization problem.  Finding a robust
solution that simply sends a message (over REST even) to a
running java daemon from a OS event would be ideal.

So if I understand correctly, ReadDirectoryChangesW uses the
windows Last Accessed property, which is stored with the file.
This doesn't quite cut it because it relies on a polling of the
entire filesystem periodically checking last accessed stats.

Maybe it's possible to access the guts of the filesystem?
I'm not an expert in OS-level programming, but it seems like
there should be some sort of event or notification that can be
tapped into.

Eric



More information about the P2p-hackers mailing list