Node.js 原生提供了包文件系统,允许您读取、写入,尤其是对文件进行监视。
我的问题是 fs watch 不允许您知道文件何时打开或关闭
我想知道是否有其他软件包可以执行此操作,您能帮我吗?
最佳答案
您可以使用flag r+
为此。
fs.open('filename.doc','r+', function(err,data) {
// throws an error when the file is opened
});
关于javascript - 如何知道文件是否实际打开或关闭?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52892315/