In Perl, how do I safely create a temporary FIFO?

前端 未结 2 706
南旧
南旧 2021-02-05 17:08

To compare with diff adjacent records from a file, I created two FIFOs, forked children to supply their write ends, and captured the output of

diff -ub $previous         


        
2条回答
  •  被撕碎了的回忆
    2021-02-05 17:45

    Assuming all the process ends are connected to the FIFOs you created, can't you just remove them from the filesystem? The opened filehandles will keep the FIFO from being deleted, but no new handles could be attached to it, and once the existing filehandles are closed, the FIFO itself will disappear.

提交回复
热议问题