GNU bug report logs -
#21432
25.0.50; file-notify-rm-watch (inotify) errors if watched dir is deleted
Previous Next
Reported by: Tassilo Horn <tsdh <at> gnu.org>
Date: Tue, 8 Sep 2015 06:37:01 UTC
Severity: normal
Found in version 25.0.50
Done: Michael Albinus <michael.albinus <at> gmx.de>
Bug is archived. No further changes may be made.
Full log
Message #14 received at 21432 <at> debbugs.gnu.org (full text, mbox):
> From: Tassilo Horn <tsdh <at> gnu.org>
> Date: Tue, 08 Sep 2015 08:36:06 +0200
>
> Right now, (at least) the inotify version of `file-notify-rm-watch'
> signals an error in case the given descriptor denotes a directory which
> has been deleted in the meantime. If it denotes a file which has been
> deleted, no error is signaled.
>
> Here's a receipe:
>
> (require 'filenotify)
> (let* ((flags '(change))
> (handler (lambda () nil))
> (file (make-temp-file "foo"))
> (file-watch (file-notify-add-watch file flags handler))
> (dir (make-temp-file "bar" t))
> (dir-watch (file-notify-add-watch dir flags handler)))
> (delete-file file)
> (delete-directory dir)
> (file-notify-rm-watch file-watch) ;; works
> (message "Removed file watch")
> (file-notify-rm-watch dir-watch) ;; signals an error
> (message "Removed directory watch"))
>
> The documentation does not define any specific behavior for these
> situation, so this is currently a gray area which makes it hard for
> package developers to develop something which will work right accross
> the different notification backends.
>
> I don't have a strong opinion about what the right behavior would be but
> at least it seems inconsistent that you get the error only with deleted
> directories.
There is no "right" behavior. What you see is what the back-end
reports to us. If we want Emacs to be smarter, it's the job of the
application, not of filenotify.el.
This bug report was last modified 9 years and 246 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.