{"categories":["\u96d1\u8a18","ruby","program"],"image_url":null,"version":"1.0","height":"190","url":"https://cookies.hatenablog.jp/entry/2012/10/08/020354","author_name":"cookie-s","provider_name":"Hatena Blog","blog_title":"cookies.txt\u3000\u3000\u3000\u3000\u3000\u3000.scr","blog_url":"https://cookies.hatenablog.jp/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fcookies.hatenablog.jp%2Fentry%2F2012%2F10%2F08%2F020354\" title=\"\u521d\u3081\u3066\u306e\u5fae\u5999\u306b\u4f7f\u3048\u308bRuby\u30b9\u30af\u30ea\u30d7\u30c8 - cookies.txt\u3000\u3000\u3000\u3000\u3000\u3000.scr\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","title":"\u521d\u3081\u3066\u306e\u5fae\u5999\u306b\u4f7f\u3048\u308bRuby\u30b9\u30af\u30ea\u30d7\u30c8","published":"2012-10-08 02:03:54","width":"100%","type":"rich","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/cookie-s/","description":"\u306f\u3066\u306a\u8a18\u6cd5\u306e\u30c6\u30b9\u30c8\u306e\u3064\u3044\u3067\u306b\u3002\u306a\u3093\u3068\u306a\u304fRuby\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u304d\u3064\u304f\u308b\u3002 #!ruby require \"socket\" require \"thread\" s0 = TCPServer.open(ARGV[1]) while true do sock = s0.accept Thread.new(sock) do |sock| io = IO.popen(ARGV[0],\"r+\") Thread.new([io,sock]) do |args| while args[0].gets args[1].puts $_ end end Thread.new([io,sock]) do |args|\u2026"}