Re: File notification [was Re: Translations of folder names - two proposals]



On Fri, 2004-12-10 at 19:38 +0000, Alan Cox wrote:
> On Gwe, 2004-12-10 at 20:27, Jamie McCracken wrote:
> > I was thinking more along the lines of Medusa (as a daemon) managing the
> > metadata than Nautilus. Non-local and non-native partitions might
> > require additional notification mechanisms but that shouldn't stop us
> > having things like Medusa and indexers like Beagle which could "just
> > work" locally without having to watch every file on your hard drive.
> 
> Watch subtree would certainly be more effective and scalable providing
> you can get the information out in a useful manner. 

That would be an improvement but it would still be less efficient than
having the kernel directly notify without any filtering when a file
modification has taken place - IE when the last modified timestamp on a
file is set by the kernel (note also Im not interested in notifying file
reads that INotify offers here cause that would obviously generate a lot
of useless noise). 

It would be interesting to see what OS/X tiger uses for its indexer
though I suspect it uses unfiltered kernel notification on writes too.

We also already have requirements for filesystem wide notification with
things like locate too so I dont see much benefit in simply watching a
subset of your filesystem.

> For an indexer thats
> quite tricky - one approach would be to hand the indexer a read only
> file handle to the object when it closes or after some kind of timeout
> iff the indexer is the same uid as the closer. Otherwise if I pass a
> path name the file may have moved again.

I'm not sure if thats a problem cause if you used Dbus you would have a
queue of file notification messages so it shouldn't be too hard whilst
attempting to index file x to keep an eye out for a dbus message that
says "file x was deleted" if it was moved shortly afterwards.
Incorporating an artificial lag into the indexer should also help
alleviate problems with fast changing files so that it only indexes
when theirs some stability to a file.


jamie.







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]