助田です
In message "Re: [ruby-list:5258] Re: read from subprocess"
Masaki Suketa <masaki.suketa / tonen.co.jp> writes :
>とりあえず 今度 971021版にしてからもう一度試してみます。
現象かわりませんでした。
で、こんな風にしてみたら期待通りの結果になりました。
port = IO.new(channel, "r") #読み込み専用
port2 = IO.new(channel, "w") #書き込み専用
port2.sync = TRUE #常にフラッシュさせないと駄目
i = port.read(4)
i.each_byte {|byte|
printf($stderr, "ipc0.rb: int byte = %x\n", byte)
}
port2.write("OK")
s = port.read(4)
printf($stderr, "ipc0.rb: str = %s\n", s)
port2.write("OK")
助田 雅紀(masaki.suketa / tonen.co.jp)