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: Fri, 11 Jan 2013 17:50:42 +0200

> From: Michael Albinus <address@hidden>
> Cc: Stefan Monnier <address@hidden>,  address@hidden
> Date: Fri, 11 Jan 2013 16:01:14 +0100
> 
> >> For auto-revert-tail-mode, IN_CLOSE_WRITE is definitely insufficient
> >> since the common use case is when we watch a log file, so the CLOSE may
> >> never happen.
> 
> I can speak only for the inotify case. According to my tests,
> IN_CLOSE_WRITE will always happen once a file has been written on the
> filesystem. See for example (commands have been applied in different shells):

The documentation (inotify(7) page) clearly says

    IN_CLOSE_WRITE

    File opened for writing was closed

> --8<---------------cut here---------------start------------->8---
> ~$ echo xxx >>~/tmp/123
> 
> ~$ inotifywait -mq ~/tmp/123
> /home/albinmic/tmp/123 OPEN 
> /home/albinmic/tmp/123 MODIFY 
> /home/albinmic/tmp/123 CLOSE_WRITE,CLOSE 
> --8<---------------cut here---------------end--------------->8---
> 
> Do you (Stefan?) have a use case where just IN_MODIFY has been fired,
> w/o a corresponding IN_CLOSE_WRITE?

Maybe I'm missing something, but the above example is not the issue at
hand.  The issue at hand is to have several separate writes to a file
with some significant time between them.  AFAIU, in the above example
the file is written once and then closed.

> > I would suggest adding the 'size' filter as well, because Windows
> > doesn't update the last write time on every write to a file, only
> > after many writes.  (It does similar filtering with updating the
> > directory entry of the file, so 'size' alone will not do.)
> 
> Hmm, as said already I have almost no chance to test it under Windows ...
> I would let this implementation to somebody else.

So now we will have features which, although equivalent, are only
implemented on the platform of the implementer's choice?  If so, what
good is it to have the same feature implemented on different
platforms?



reply via email to

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