Reliably reading from a FIFO in NodeJS

后端 未结 1 1551
长发绾君心
长发绾君心 2021-01-23 20:53

I\'m writing a NodeJS script which interacts with a 3rd party application. The third party application will write data to a file for the duration that it\'s open. I\'d like for

1条回答
  •  心在旅途
    2021-01-23 21:07

    Of course I figure it out as soon as I ask the question.

    let pipeHandle = await promisify(fs.open)(pipePath, fs.constants.O_RDWR);
    

    This opens the fifo without blocking, because it connects a writer and a reader at the same time. There can be multiple writers for a fifo, so the 3rd-party app is still able to connect without any issues.

    0 讨论(0)
提交回复
热议问题