<分区>
我看到在 fs.js
的顶部有一个 process.binding('fs')
。
https://github.com/nodejs/node/blob/master/lib/fs.js#L10 :
const binding = process.binding('fs');
然后,它被用作:
binding.open(pathModule._makeLong(path),
stringToFlags(flag),
0o666,
req);
(在 https://github.com/nodejs/node/blob/master/lib/fs.js#L303-L306 中)
我的问题是:
process.binding('fs')
是什么意思?- 这里的
fs
是什么(我们已经在fs.js
中了)? - 在哪里可以找到
binding.open
的源代码?是 Javascript 代码还是 c/c++ 代码?