Method: ChildProcess::Windows::Lib.io_for

Defined in:
lib/childprocess/windows/lib.rb

.io_for(handle, flags = File::RDONLY) ⇒ Object



331
332
333
334
335
336
337
338
# File 'lib/childprocess/windows/lib.rb', line 331

def io_for(handle, flags = File::RDONLY)
  fd = open_osfhandle(handle, flags)
  if fd == -1
    raise Error, last_error_message
  end

  FFI::IO.for_fd fd, flags
end