emacs-devel
[Top][All Lists]
Advanced

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

Re: File watch support in autorevert.el


From: Eli Zaretskii
Subject: Re: File watch support in autorevert.el
Date: Sat, 12 Jan 2013 13:36:05 +0200

> From: Michael Albinus <address@hidden>
> Date: Fri, 11 Jan 2013 23:47:41 +0100
> Cc: Eli Zaretskii <address@hidden>, address@hidden
> 
> Stefan Monnier <address@hidden> writes:
> 
> >> Will do for the inotify case. It is a simple bit easier, because you can
> >> install a file watch for exactly one file, and you can expect it returns
> >> for that file only.
> >
> > BTW, what happens if the file gets overwritten without touching its
> > inode (e.g. use auto-revert-mode on ~/foo and then do "mv ~/bar ~/foo"
> > and then "echo toto >>~/foo")?
> >
> > You'll presumably get some notification of the "mv" itself, but will you
> > subsequently get the notification of the "echo" (which is now modifying
> > another inode than the original ~/foo)?
> 
> No further notifications. I've realized it just now, because this is the
> scenario when you save a file with `backup-by-copying' set to nil. You
> will loose further notifications, because the file was moved away.
> 
> Tested in the inotify case. For w32notify, I don't know.

Windows is at advantage here, since it watches the entire directory.
So when the new "foo" is created and gets updated, the notifications
come in and the file is auto-reverted.

Perhaps the inotify implementation should watch the parent directory
instead of the file.

The rename notification doesn't come in, because we didn't request
it.  To request it (if we need that), wee should add 'file-name' to
the list of w32notify filters.  AFAIU, with inotify we need to use
'move' to get notifications about renames.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]