coreutils
[Top][All Lists]
Advanced

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

[PATCH] tail should dereference watched file


From: Ondrej Oprala
Subject: [PATCH] tail should dereference watched file
Date: Fri, 13 Sep 2013 17:42:40 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8

Hi,

Since inotify is dereferencing the files it's told to watch (according to flags tail sets), the watched files should be dereferenced outside the inotify_* family of functions as well.
Example:
$ echo 1  > file
$ ln -sf file{,-link}
$ tail -F ./filelink > out 2>/dev/null
$ rm file
$ echo 2 > file
$ kill %1
$ cat out
results: out only contains the contents of "file" before it was deleted.
expected results: tail picks up on "file"'s reappearance.

To be precise, tail actually picks up on it. However, the list of watched files from inotify is a list of files after dereferencing, whereas tail compares it to the filenames of symlinks it got as arguments, resulting ofc in unhappy users.
Thanks,
Ondrej

Attachment: tail-deref.patch
Description: Text Data


reply via email to

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