【发布时间】:2019-03-16 04:37:14
【问题描述】:
我正在尝试为一个项目重新创建 fs.watchFile(),但我对某个特定主题有点困惑。问题是这个回调函数的参数 curr 和 prev 是如何填充的?
fs.watchFile('message.text', (curr, prev) => {
console.log(`the current mtime is: ${curr.mtime}`);
console.log(`the previous mtime was: ${prev.mtime}`);
});
我检查了节点目录并分析了 watchFile() 函数的定义,但发现它只返回一个 stat 对象的实例。
【问题讨论】:
标签: javascript node.js filesystems