lucagrulla/node-tail — pull request #25 by bra1n (2014-07-26 19:26:48+00:00)
Title: Allow users to ignore fs.watch "rename" events

Hi,

I have a log file that I want to watch and which triggers "rename" events every now and then, without being actually renamed, truncated or deleted. If I do a normal `tail -f logfile`, I get the updates as expected. When using node-tail, however, the internal `fs.watch` treats some of the updates as `rename` events rather than `change` events. This might be a platform issue (I'm using Mac OSX) or an issue with the process that creates the logfile (I have no idea) - but when I force node-tail to use `fs.fileWatch`, the problem goes away.
Since `rename` events reset the interal position and have a 1 second reload-delay, I'd like there to be a way to ignore these `rename` events and treat them as normal `change` events. Since `change` handles logfiles that are suddenly a lot shorter (ie. when actually renaming a file an replacing it with an empty one) perfectly fine, I don't see any harm in adding an option that allows the user to override the default behevaiour.
What do you think?

Cheers,
Steffen