Re: [Nautilus-list] Re: fam question



On Fri, 26 Oct 2001, Darin Adler wrote:

> on 10/26/01 1:31 PM, Alex Larsson at alexl redhat com wrote:
> 
> > On Fri, 26 Oct 2001, Darin Adler wrote:
> > 
> >> As far as I can tell, FAM doesn't notify you if you are monitoring a file
> >> (not the file's directory) and you delete that file. Is that a bug in the
> >> Red Hat FAM, or working as designed? Maybe monitoring a file just monitors
> >> the inode? Can I monitor a file name and find out when that file name is
> >> unlinked without monitoring the whole directory it's in?
> > 
> > It worked for me.
> > 
> > Just running the test app from the fam distro:
> > 
> > bash-2.05$ fam_test -f /tmp/x/1
> > FAMMonitorFile("/tmp/x/1")
> > FAMMonitorFile("/tmp/x/1")
> > FILE /tmp/x/1:   /tmp/x/1 Exists
> > FILE /tmp/x/1:   /tmp/x/1 EndExist
> > FILE /tmp/x/1:   /tmp/x/1 was deleted
> > 
> > In what context did this not work?
> 
> OK. I see what I forgot to mention. Try it again with a directory. So
> /tmp/x/1 should be a directory, not a file.
> 
> That's the case that didn't work.

Oh no. More dnotify crap.

Yeah, that doesn't work. Detecting permission changes to the directory 
doesn't work either.

The reason is that monitoring a directory with dnotify monitors only the 
contents of the directory, not the directory itself. I sent mail to the 
linux kernel list about this today, hoping to get a change in semantics 
into the kernel.

I will have to work around this for now, by watching the parent directory 
too. I'll do that next week.

Did I mention that dnotify is a crap interface? Oh, I did...

/ Alex





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