Reputation: 81
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?
Upvotes: 7
Views: 4473
Reputation: 34061
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')
Upvotes: 10