Juul/tail-stream

File getting truncated with 'beginAt' set to 'end' not always detected

Opened this issue · 1 comments

When the 'beginAt' option is set to 'end', before the file grows for the first time, no matter how much that file gets truncated, it will not be detected and all new data is completely skipped until the file grows beyond its original size again.

As far as I can tell, you need to add this.lastSize = stat.size; somewhere inside this if-block:

if(this.firstRead && (this.opts.beginAt == 'end')) {

Juul commented