bug-textutils
[Top][All Lists]
Advanced

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

Problem with tail (includes patch to fix it)


From: Tomas Halvarsson
Subject: Problem with tail (includes patch to fix it)
Date: Thu, 5 Jul 2001 14:37:22 +0200 (MET DST)

Hello,

On my Linux system, I'm having problems getting 'tail -f' to
follow FIFOs. When tail starts, the last 10 lines present in the
FIFO are printed, but all subsequent writes to the FIFO go
unnoticed by tail.

Looking at the source code to tail, I found that the problem was
that tail looks at the size of the files it's following. The size
of a FIFO is always 0, resulting in tail not discovering the new
data available in the FIFO.

A small patch, which checks if the file is a FIFO and in that
case looks at the st_mtime stat struct field instead, has worked
well for me so far. The patch, which can be applied with the
'patch -p0' command, is attached to this mail, and I'd be happy
if you included it in any future releases of tail/textutils
(possibly adding some command line option to activate the patch,
if the functionality of it conflicts with other aspects of tail).

/Tomas

Attachment: tail_patch
Description: Text document


reply via email to

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