Re: Detecting changes in a directory tree

Jeroen van Disseldorp
2003-01-17T03:49:38Z

On Thursday 16 January 2003 19:59, Adrian Bunk wrote:
> with a kernel >= 2.4.19 dnotify [1] might do what you want.

Close, but is doesn't do it quite for me. I understand the problem of
traversing inodes back up the tree, once they have changed, to see
whether someone wants to receive an event. However I am not convinced
that this is necessary. The idea I had was the following:

I would like to have a passthrough kind of filesystem (lets call is myfs
for now) that can mount other parts of the filesystem and just maps
everything to the original tree. For instance, I would mount /var on
/mnt/var, using myfs. Everything from /mnt/var is directly mapped to
/var.

The clue of this is that myfs *knows* about the notification, because it
has to send notification to userspace for *every* inode. So if anything
is written in /mnt/var, it can notify userspace. BTW for my app it
would be acceptable that direct changes in /var don't lead to any
events.

I haven't thought out the interface to userspace yet, but I think that
can be worked out. Let me know if I'm making any sense here.

Regards,
Jeroen mailto:jdizzl@xs4all.nl
--
Be the change that you want to see in the world -- Gandhi