Class: QDA::Filters::Win32Process::Win32popenIO

Inherits:
Object
  • Object
show all
Defined in:
lib/openc3/win32/win32.rb

Instance Method Summary collapse

Constructor Details

#initialize(hRead, hWrite, hError) ⇒ Win32popenIO

Returns a new instance of Win32popenIO.



334
335
336
337
338
# File 'lib/openc3/win32/win32.rb', line 334

def initialize(hRead, hWrite, hError)
  @hRead  = hRead
  @hWrite = hWrite
  @hError = hError
end

Instance Method Details

#readObject



344
345
346
347
# File 'lib/openc3/win32/win32.rb', line 344

def read
  sleep(0.01) while Win32Process.peek_named_pipe(@hRead).zero?
  Win32Process.read_file(@hRead)
end

#read_allObject



349
350
351
352
353
354
355
# File 'lib/openc3/win32/win32.rb', line 349

def read_all
  all = ''
  until (buffer = read).empty?
    all << buffer
  end
  all
end

#read_all_errObject



362
363
364
365
366
367
368
# File 'lib/openc3/win32/win32.rb', line 362

def read_all_err
  all = ''
  until (buffer = read_err).empty?
    all << buffer
  end
  all
end

#read_errObject



357
358
359
360
# File 'lib/openc3/win32/win32.rb', line 357

def read_err
  sleep(0.01) while Win32Process.peek_named_pipe(@hError).zero?
  Win32Process.read_file(@hError)
end

#write(data) ⇒ Object



340
341
342
# File 'lib/openc3/win32/win32.rb', line 340

def write(data)
  Win32Process.write_file(@hWrite, data.to_s)
end