Class: QDA::Filters::Win32Process::Win32popenIO
- Defined in:
- lib/openc3/win32/win32.rb
Instance Method Summary collapse
-
#initialize(hRead, hWrite, hError) ⇒ Win32popenIO
constructor
A new instance of Win32popenIO.
- #read ⇒ Object
- #read_all ⇒ Object
- #read_all_err ⇒ Object
- #read_err ⇒ Object
- #write(data) ⇒ Object
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
#read ⇒ Object
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_all ⇒ Object
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_err ⇒ Object
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_err ⇒ Object
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 |