lucagrulla / node-tail

The zero dependency Node.js module for tailing a file
https://www.lucagrulla.com/node-tail/
MIT License
466 stars 75 forks source link

rename logic is incorrect on Linux #131

Open lucagrulla opened 3 years ago

lucagrulla commented 3 years ago

the rename logic didn't work without swapping:

if (filename === undefined || filename !== this.filename) {

to

if (filename === undefined || filename === this.filename) {

this was on Linux,[...] It would seem on Linux that the rename argument is the "from" filename, I guess?[...]

Originally posted by @bruce-one in https://github.com/lucagrulla/node-tail/issues/130#issuecomment-816278020

joac commented 2 months ago

Had this issue, I think the approach from https://github.com/logdna/tail-file-node to handle renames is a lot more reliable.