Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 03 Mar 2024 11:30:48 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 275465] "tail -F/f foo" doesn't show the file content when foo is truncated
Message-ID:  <bug-275465-227-fA35URB8NR@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-275465-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | previous in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275465

Daniel Tameling <tamelingdaniel@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tamelingdaniel@gmail.com

--- Comment #2 from Daniel Tameling <tamelingdaniel@gmail.com> ---
I think that the kevent in forward.c doesn't return for the truncation itself
but only after the truncation + write. At that point, the code can't figure out
whether it needs to reread the entire file. It just sees the difference in file
sizes. See for example:

$ touch test.txt                                                                
$ echo -n 123 > test.txt                                                        
$ echo -n 456789 > test.txt                                                     
$ echo -n a > test.txt                                                          
$ echo -n bcdef > test.txt

gives the output

$ tail -f test.txt                                                              
123789cdef

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-275465-227-fA35URB8NR>