Closed Zoro-6191 closed 3 years ago
Hey,
I can't see anything wrong.
It's probably caused by fs.watch
implementation, the nodejs core function used by tail
, that doesn't have 100% compatibility across different OSes:
https://nodejs.org/dist/latest-v14.x/docs/api/fs.html#fs_caveats
On Windows, you could try to use WatchFile
instead of watch
, by useWatchFile as a constructor parameter:
https://github.com/lucagrulla/node-tail#constructor-parameters
I hope it helps.
thanks for fast response my program will mostly be running on linux, so its fine I'll try switching to watchFile() for windows use, although it would be good if you perfected the method from your end since I'm not really experienced in the thing
Do you think we need to mention fs.watchFile is actually polling the file and has a default interval of 5007ms? Cost me another 20min to figure this out lol.
Hi, I'm not sure if I missed something or some extra step, but same code which gives good response on all of my linux systems doesnt give same result in windows
that's literally all of the code
that console.log doesnt output anything at all unless I close the program which is writing to the log file.As soon as I quit the program thats writing to the log file, all of the log data gets printed to console at once. That behavior is exhibited only on windows. Same writing program on linux. And console.log output is perfect. Please let me know if I'm doing anything wrong. Thanks