bug-coreutils
[Top][All Lists]
Advanced

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

bug#5941: tail bug


From: Andreas Schwab
Subject: bug#5941: tail bug
Date: Tue, 13 Apr 2010 23:39:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.95 (gnu/linux)

Eric Kever <address@hidden> writes:

> I've created a file 'foo', and used tail -f to follow the changes to that
> file.
> I then wrote 'test' to the file and saved it, and tail reported 'test',
> which is fine.
> I then deleted 'test' and saved the file, and tail reported 'tail: foo:
> file truncated', which is fine.
> I then wrote 'test' again and saved the file, and tail reported 'est'
> instead of 'test'.

That's not a bug.  When you truncated the file you actually wrote a
single newline, so the current position became one character into the
file.  The fact that the next modification overwrote the newline (with
`t') wasn't noticed by tail, because it only watches for modifications
after the current end-of-file.

Try using an editor that actually allows you to write an empty file (or
use `> foo' in the shell).

Andreas.

-- 
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."






reply via email to

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