bug-coreutils
[Top][All Lists]
Advanced

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

Re: inotify back end for tail -f on linux


From: Jim Meyering
Subject: Re: inotify back end for tail -f on linux
Date: Sat, 13 Jun 2009 17:54:53 +0200

Giuseppe Scrivano wrote:

> Jim, thank for the review.
>
> Jim Meyering <address@hidden> writes:
>
>> Perhaps "prev_wd" would be more accurate?
>
> I fixed it.  The same name is used in `tail_forever', that is why I used
> it, should it be changed in `tail_forever' too?
>
>
>> Another regression:
>>
>>     touch k; chmod 0 k; tail -F k
>>
>> fails to open "k" (as it must), but even
>> when I run "chmod u+r k" in another window,
>> the inotify-based version of tail fails to open it.
>
> I fixed it.
>
> This version includes, among other things, a refactoring of the new
> tests as previously reported.

Thanks again.
I found an undesired change in functionality.
inotify-enabled tail -F sometimes follows the file descriptor of a
renamed file, which is contrary to the semantics of --follow=name.
The non-inotify version follows the name, not the file descriptor in
that case.

For example:

    echo>k; ./tail -F k & sleep .5; mv k l; sleep .5; touch k; mv k l; \
      sleep .5; echo NO >> l
    ./tail: `k' has become inaccessible: No such file or directory
    ./tail: `k' has appeared;  following end of new file
    NO

Contrast with this:

  echo>k; /usr/bin/tail -s.1 -F k & sleep .5; mv k l; sleep .5; touch k; mv k 
l;\
    sleep .5; echo NO >> l
  /usr/bin/tail: `k' has become inaccessible: No such file or directory




reply via email to

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