Re: [patch] inotify 0.22

From: Robert Love
Date: Mon Apr 04 2005 - 16:18:25 EST


On Mon, 2005-04-04 at 16:50 -0400, Dale Blount wrote:

Hi, Dale.

> Will inotify watch directories recursively? A quick browse through the
> source doesn't look like it, but I very well could be wrong. Last I
> checked, dnotify did not either. I am looking for a way to synchronize
> files in as-real-as-possible-time when they are modified.

No, inotify does not support watching directories recursively. I would
love to add it, but it would be a mess to do inside of the kernel.

Making it easy and efficient to watch a full tree, however, was a goal
of inotify. Beagle, a personal indexing infrastructure, watches the
user's entire home directory.

You could never do this in dnotify because you would run out of file
descriptors and pin every file.

In inotify, it is not hard to write a simple recursive loop to add a
watch to each directory starting at a given path. It can even be done
in an atomic fashion. See

http://mail.gnome.org/archives/dashboard-hackers/2004-October/msg00022.html

wherein I publish such an algorithm.

Hope this helps,

Robert Love


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/