Juul / tail-stream

Like `tail -f` but a stream. Like fs.createReadStream but keeps reading as the file grows.
Other
33 stars 13 forks source link

Preventing EBADF errors from async close operation. #18

Closed plastbox closed 7 years ago

plastbox commented 7 years ago

Calling tail-stream.end() inside a downstream stream handler (f.ex. piping tail-stream to a Transform-stream implementing a filter) causes the file to be closed after read has been called, but before readCont. This causes an exception as the file pointer is NULL'ed in the callback of fs.close(this.fd...