From: Eli Zaretskii <eliz@gnu.org>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: 21435@debbugs.gnu.org, tsdh@gnu.org
Subject: bug#21435: 25.0.50; file-notify has problems after renames
Date: Wed, 09 Sep 2015 22:21:17 +0300 [thread overview]
Message-ID: <83h9n35rgy.fsf@gnu.org> (raw)
In-Reply-To: <8737ynv3ik.fsf@gmx.de>
> From: Michael Albinus <michael.albinus@gmx.de>
> Cc: tsdh@gnu.org, 21435@debbugs.gnu.org
> Date: Wed, 09 Sep 2015 20:41:55 +0200
>
> >> I couldn't test this for w32notify, but it should behave like this since
> >> Sunday.
> >
> > If you can show some simple test case, I can run it.
>
> Well, something like this:
>
> --8<---------------cut here---------------start------------->8---
> (progn
> (require 'filenotify)
> (defalias 'myhandler1 'ignore)
> (defalias 'myhandler2 'ignore)
> (file-notify-add-watch "/tmp" '(change) 'myhandler1)
> (file-notify-add-watch "~/tmp" '(change) 'myhandler2)
> (trace-function 'file-notify-handle-event)
> (trace-function 'myhandler1)
> (trace-function 'myhandler2))
> --8<---------------cut here---------------end--------------->8---
>
> Then you do outside Emacs (inotify case):
>
> --8<---------------cut here---------------start------------->8---
> # echo xxx >/tmp/xxx
>
> ======================================================================
> 1 -> (file-notify-handle-event (file-notify (1 (create) "xxx" 0) file-notify-callback))
> | 2 -> (myhandler1 ((1) created "/tmp/xxx"))
> | 2 <- myhandler1: nil
> 1 <- file-notify-handle-event: nil
> ======================================================================
> 1 -> (file-notify-handle-event (file-notify (1 (modify) "xxx" 0) file-notify-callback))
> | 2 -> (myhandler1 ((1) changed "/tmp/xxx"))
> | 2 <- myhandler1: nil
> 1 <- file-notify-handle-event: nil
This behaves the same on w32:
======================================================================
1 -> (file-notify-handle-event (file-notify (100286560 added "xxx") file-notify-callback))
| 2 -> (myhandler1 (100286560 created "d:/tmp/xxx"))
| 2 <- myhandler1: nil
1 <- file-notify-handle-event: nil
======================================================================
1 -> (file-notify-handle-event (file-notify (100286560 modified "xxx") file-notify-callback))
| 2 -> (myhandler1 (100286560 changed "d:/tmp/xxx"))
| 2 <- myhandler1: nil
1 <- file-notify-handle-event: nil
> # mv /tmp/xxx ~/tmp/
>
> ======================================================================
> 1 -> (file-notify-handle-event (file-notify (1 (moved-from) "xxx" 49278) file-notify-callback))
> 1 <- file-notify-handle-event: nil
> ======================================================================
> 1 -> (file-notify-handle-event (file-notify (2 (moved-to) "xxx" 49278) file-notify-callback))
> | 2 -> (myhandler1 ((1) renamed "/tmp/xxx" "/home/albinus/tmp/xxx"))
> | 2 <- myhandler1: nil
> | 2 -> (myhandler2 ((2) renamed "/tmp/xxx" "/home/albinus/tmp/xxx"))
> | 2 <- myhandler2: nil
> 1 <- file-notify-handle-event: nil
> --8<---------------cut here---------------end--------------->8---
>
> That looks good.
This doesn't work at all on w32 (I used d:/usr/eli/data instead of
~/tmp), it reports removal and addition (and also a bogus 2nd
removal):
======================================================================
1 -> (file-notify-handle-event (file-notify (100286608 removed "xxx") file-notify-callback))
| 2 -> (myhandler2 (100286608 deleted "d:/usr/eli/data/xxx"))
| 2 <- myhandler2: nil
1 <- file-notify-handle-event: nil
======================================================================
1 -> (file-notify-handle-event (file-notify (100286608 added "xxx") file-notify-callback))
| 2 -> (myhandler2 (100286608 created "d:/usr/eli/data/xxx"))
| 2 <- myhandler2: nil
1 <- file-notify-handle-event: nil
======================================================================
1 -> (file-notify-handle-event (file-notify (100286560 removed "xxx") file-notify-callback))
| 2 -> (myhandler1 (100286560 deleted "d:/tmp/xxx"))
| 2 <- myhandler1: nil
1 <- file-notify-handle-event: nil
Let me know what I should look into or which additional information I
can give you about this.
next prev parent reply other threads:[~2015-09-09 19:21 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-08 8:47 bug#21435: 25.0.50; file-notify has problems after renames Tassilo Horn
2015-09-08 16:03 ` Eli Zaretskii
2015-09-08 18:04 ` Michael Albinus
2015-09-08 18:21 ` Eli Zaretskii
2015-09-08 19:28 ` Tassilo Horn
2015-09-09 18:15 ` Michael Albinus
2015-09-09 19:01 ` Tassilo Horn
2015-09-09 20:23 ` Tassilo Horn
2015-09-10 11:23 ` Michael Albinus
2015-09-10 15:31 ` Tassilo Horn
2015-09-10 17:50 ` Michael Albinus
2015-09-10 19:22 ` Tassilo Horn
2015-09-11 9:53 ` Michael Albinus
2015-09-11 12:17 ` Tassilo Horn
2015-09-11 12:32 ` Eli Zaretskii
2015-09-12 8:44 ` Michael Albinus
2015-09-11 9:45 ` Michael Albinus
2015-09-11 12:11 ` Tassilo Horn
2015-09-09 18:41 ` Michael Albinus
2015-09-09 19:21 ` Eli Zaretskii [this message]
2015-09-10 11:09 ` Michael Albinus
2015-09-10 15:45 ` Eli Zaretskii
2015-09-10 17:37 ` Michael Albinus
2015-09-10 18:03 ` Eli Zaretskii
2015-09-10 18:20 ` Michael Albinus
2015-09-10 18:55 ` Eli Zaretskii
2015-09-11 12:51 ` Michael Albinus
2015-09-08 19:05 ` Tassilo Horn
2015-09-08 19:19 ` Eli Zaretskii
2015-09-08 19:47 ` Tassilo Horn
2015-09-09 2:39 ` Eli Zaretskii
2015-09-09 6:13 ` Tassilo Horn
2015-09-20 17:26 ` Michael Albinus
2015-09-20 19:36 ` Eli Zaretskii
2015-09-21 6:25 ` Michael Albinus
2015-09-21 7:54 ` Eli Zaretskii
2015-09-21 10:13 ` Michael Albinus
2015-09-21 10:14 ` Eli Zaretskii
2015-09-21 13:11 ` Michael Albinus
2015-09-21 13:31 ` Eli Zaretskii
2015-09-21 13:38 ` Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83h9n35rgy.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=21435@debbugs.gnu.org \
--cc=michael.albinus@gmx.de \
--cc=tsdh@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).