Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
require 'ffi'
require 'jnr-enxio-0.1.jar'
module Open
extend FFI::Library
ffi_lib 'c'
attach_function :open, [:string, :int], :int
end
fd = Open.open('fifo', File::RDONLY | File::NONBLOCK)
channel = Java::jnr.enxio.channels.NativeDeviceChannel.new(fd)
io = channel.to_io
puts io.gets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.