1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

rdoc update.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-12-17 15:48:22 +00:00
parent 0a3a98aea4
commit d74d2d13cb

View file

@ -452,19 +452,20 @@ pty_close_pty(VALUE assoc)
* *
* The filename of the slave is slave_file.path. * The filename of the slave is slave_file.path.
* *
* # make cut's stdout line buffered. * # Change the buffering type in factor command,
* # if IO.pipe is used instead of PTY.open, * # assuming that it uses stdio for stdout buffering.
* # this deadlocks because cut's stdout will be fully buffered. * # If IO.pipe is used instead of PTY.open,
* # this deadlocks because factor's stdout is fully buffered.
* m, s = PTY.open * m, s = PTY.open
* system("stty raw", :in=>s) # disable newline conversion. * system("stty raw", :in=>s) # disable newline conversion.
* r, w = IO.pipe * r, w = IO.pipe
* pid = spawn("cut -c 3-8", :in=>r, :out=>s) * pid = spawn("factor", :in=>r, :out=>s)
* r.close * r.close
* s.close * s.close
* w.puts "foo bar baz" #=> "o bar \n" * w.puts "42"
* p m.gets * p m.gets #=> "42: 2 3 7\n"
* w.puts "hoge fuga moge" #=> "ge fug\n" * w.puts "144"
* p m.gets * p m.gets #=> "144: 2 2 2 2 3 3\n"
* *
*/ */
static VALUE static VALUE