Subject: bug#21432: 25.0.50; file-notify-rm-watch (inotify) errors if watched dir is deleted

From: Tassilo Horn <[email-masked]>
Date: Mon, 14 Sep 2015 09:56:12 +0200

Tassilo Horn <[email-masked]> writes:

>>> What seems wrong to me is that the descriptors stay valid even when
>>> the watched file or directory is deleted.  For files this might be
>>> ok (though maybe inotify-specific) because when I create a new file
>>> with the same name, the watch will trigger.
>>> 
>>> However, the current hehavior is certainly wrong for directories.
>>> When I deleted the watched directory, the descriptor is still valid,
>>> but calling file-notify-rm-watch on it signals an error.
>>
>> AFAIR, filenotify.el watches the parent directory of the
>> file/directory you asked it to watch.  So to see the invalid-p method
>> in action you need to remove the parent, not the directory itself.
>
> Ah, I see.  I'll adapt the tests accordingly.

Done, however the descriptors still don't become invalid when deleting
the parent directory of the watched file or directory.  I guess, that's
a problem in the inotify and TRAMP implementations then.

Bye,
Tassilo