{"type":"rich","author_url":"https://blog.hatena.ne.jp/takuya_1st/","image_url":null,"provider_url":"https://hatena.blog","author_name":"takuya_1st","version":"1.0","url":"https://takuya-1st.hatenablog.jp/entry/20120205/1328470521","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftakuya-1st.hatenablog.jp%2Fentry%2F20120205%2F1328470521\" title=\"Ruby\u306fIO.pipe\u3092\u4f7f\u3048\u3070\u3001\u30d1\u30a4\u30d7\u3092\u4f5c\u308b\u3053\u3068\u304c\u51fa\u6765\u308b   - \u305d\u308c\u30de\u30b0\u3067\uff01\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","categories":["ruby"],"width":"100%","blog_title":"\u305d\u308c\u30de\u30b0\u3067\uff01","blog_url":"https://takuya-1st.hatenablog.jp/","title":"Ruby\u306fIO.pipe\u3092\u4f7f\u3048\u3070\u3001\u30d1\u30a4\u30d7\u3092\u4f5c\u308b\u3053\u3068\u304c\u51fa\u6765\u308b  ","provider_name":"Hatena Blog","published":"2012-02-05 04:35:21","description":"IO.pipe\u3092\u4f7f\u3048\u3070\u3001\u30d1\u30a4\u30d7\u3092\u4f5c\u308b\u3053\u3068\u304c\u51fa\u6765\u308b \u30d1\u30a4\u30d7\u3092\u4f5c\u308b\u3068\u697d\u3057\u3044\u3002 o,i = IO.pipe 100.times{ i.puts :test } 100.times{ puts o.gets }\u3053\u308c\u3060\u3051 Pipe\u3092\u4f7f\u3046\u3068\u4f55\u304c\u4fbf\u5229\u304b\u3002\u30b9\u30ec\u30c3\u30c9\u3092\u30d6\u30ed\u30c3\u30af\u51fa\u6765\u308b loop{ p o. gets }\u3067 i.puts \u3092\u5f85\u3064\u3053\u3068\u304c\u51fa\u6765\u308b\u3002\u3069\u3046\u3044\u3046\u3053\u3068\u304b\u3068\u3044\u3046\u3068 IO.pipe\u306f\u30d6\u30ed\u30c3\u30af\u3059\u308b\uff1f >> input.puts \"aaaaaaaaa\" #=> nil >> input.puts \"aaaaaaaaa\" #=> nil >> input.puts \"aaaaaaaaa\" #=> nil >\u2026","height":"190"}