如何在node.js中创建一个命名管道?
P.S.:目前我是按以下方式创建命名管道。但我认为这不是最好的方法。
var mkfifoProcess = spawn('mkfifo', [fifoFilePath]);
mkfifoProcess.on('exit', function (code) {
if (code == 0) {
console.log('fifo created: ' + fifoFilePath);
} else {
console.log('fail to create fifo with code: ' + code);
}
});