Skip to content

Instantly share code, notes, and snippets.

@fsvehla
Created January 27, 2009 15:44
Show Gist options
  • Save fsvehla/53386 to your computer and use it in GitHub Desktop.
Save fsvehla/53386 to your computer and use it in GitHub Desktop.
while out_open || err_open
next unless ready = IO.select([out_pipe], [err_pipe], nil, Ticks)
if ready.flatten.include?(out_pipe)
out_open = (output.write(out_pipe.readpartial(BlockSize - 2)) rescue false)
end
if ready.flatten.include?(err_pipe)
err_open = (errors.write(err_pipe.readpartial(BlockSize - 2)) rescue false)
end
puts 'out: %6s | err %6s' % [out_open, err_open]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment