I am trying to create a named pipe inside Ruby. Besides using the system
command (system("mkfifo #{pipe_name}")
), is there a native Ruby function allowing me to do this?
Current versions of Ruby (starting with 2.3.0) now have a native File::mkfifo:
File.mkfifo('pipe_name')
Old answer for older versions of Ruby:
I don't believe there's anything fully native, but there's the mkfifo gem.
Install like this:
gem install mkfifo
Then use like this:
require "mkfifo"
File.mkfifo('pipe_name')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With