我在做网络分析。为了报告流量和用户信息,我想要read the flat file at real-time,平面文件由扩展日志格式中的用户信息组成。
需求
Reading the flat files at real-time which means, reading the particular chunk of data from the file and listening to the file for update if it is updated (new line or data added in the file) read the updated data and serve it for reporting.相似
这种技术类似于unix系统中的尾部-f。
已知
文件读取 in node.js
有任何与此要求类似的技术吗?
发布于 2013-06-12 07:32:08
有一个尾模块在内部使用fs.watchFile和fs.createReadStream
在启动时,你只需“扔掉”你不需要的每一行。总之,这可能是最简单的方法.
https://stackoverflow.com/questions/17059019
复制相似问题