[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] tail: add comments noting potential inotify-related problems
From: |
Jim Meyering |
Subject: |
Re: [PATCH] tail: add comments noting potential inotify-related problems |
Date: |
Fri, 03 Jul 2009 20:21:37 +0200 |
Giuseppe Scrivano wrote:
> Hi Jim,
>
> Jim Meyering <address@hidden> writes:
>
>> I don't (yet?) see why a tree would be the preferred data structure.
>>
>> ...
> Because inotify doesn't add recursive watchers. For example, you want
> to follow by name `/var/foo/bar', and `/var/foo' doesn't exist yet. To
> catch the event for the `bar' file creation, you will need to register a
> watcher on the /var directory and when the foo subdirectory is created
> finally watch the file.
>
> Since different files in different directories can be watched, I thought
> to use a tree to propagate events to children nodes.
Hi Giuseppe,
I'm not convinced that adding a lot of new code just to make tail -f
handle a far-fetched case like that is worthwhile. But that's just
my opinion, and if someone can present a use-case that makes it seem
the additional code would be put to good use, I'll keep an open mind ;)
For example, I've wanted to watch a *directory* for new/removed entries,
and changes to any existing or newly-created entries, but that's not
currently tail's job. If you're interested, iwatch might do what you want:
http://iwatch.sourceforge.net/index.html