Created
December 19, 2019 01:32
-
-
Save YusukeIwaki/a3421a6e0232a1b3d41af11c7815d627 to your computer and use it in GitHub Desktop.
2つ以上のIOストリームをマージする
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open3' | |
Open3.popen3("ping", "google.com") do |stdin, stdout, stderr, wait_thr| | |
stdin.close | |
while std_ready_list = IO.select([stderr, stdout])&.first | |
std_ready_list.each do |std| | |
puts ">> #{std.readline}" | |
end | |
end | |
end |
Author
YusukeIwaki
commented
Dec 19, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment