Re: [PATCH 11/16] tailf: check printing criteria more carefully

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

 



On Tue, 24 Feb 2015, Karel Zak wrote:

> On Sun, Feb 22, 2015 at 02:41:41PM +0000, Sami Kerola wrote:
> > -	if (lseek(fd, *size, SEEK_SET) != (off_t)-1) {
> > +	if (st.st_ino != old->st_ino || st.st_dev != old->st_dev
> > +	    || (old->st_mtime < st.st_mtime && st.st_size <= old->st_size))
> > +		old->st_size = 0;
> 
>  So.. if I remove (truncate) last line from 1GiB file then tailf will 
>  print all the file *again*? Would be better to reset to st.st_size if the
>  size is smaller than old->st_size?
> 
>  Or maybe if you want to support "echo 1 >| file" use case than add a
>  new option (--rewind) or so.

Thanks Karel,

The 1GiB file last line truncation is such strong argument against the 
change that I removed it from my remote branch. Maybe the tailf.1 manual 
page should mention truncations are not handled always correctly, and 
that's as good the command is ever going to be.

-- 
Sami Kerola
http://www.iki.fi/kerolasa/
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux