Project

General

Profile

Actions

Bug #3928

closed

`tail -f ...` doesn't notice file truncation

Added by Robert Mustacchi almost 9 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Normal
Category:
cmd - userland programs
Start date:
2013-07-28
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

/usr/bin/tail -f FILE doesn't notice file truncation. /opt/local/bin/tail from pkgsrc is fine with it. Mac's tail is fine with it too.

Repro:

# in one shell:
[root@headnode (bh1-kvm1:0) /var/tmp]# touch follow.log
[root@headnode (bh1-kvm1:0) /var/tmp]# tail -f follow.log
one
two
ree
three

# in another shell:
[root@headnode (bh1-kvm1:0) /var/tmp]# echo one >> follow.log
[root@headnode (bh1-kvm1:0) /var/tmp]# echo two >> follow.log
[root@headnode (bh1-kvm1:0) /var/tmp]# echo -n '' > follow.log   # wipe it
[root@headnode (bh1-kvm1:0) /var/tmp]# cat follow.log
[root@headnode (bh1-kvm1:0) /var/tmp]# echo three >> follow.log
[root@headnode (bh1-kvm1:0) /var/tmp]# echo three >> follow.log
[root@headnode (bh1-kvm1:0) /var/tmp]# echo three >> follow.log
Actions

Also available in: Atom PDF