close_write

ios.close_write â nil
Instance Public methods

Closes the write end of a duplex I/O stream (i.e., one that contains both a read and a write stream, such as a pipe). Will raise an IOError if the stream is not duplexed.

f = IO.popen("/bin/sh","r+")
f.close_write
f.print "nowhere"

produces:

prog.rb:3:in `write': not opened for writing (IOError)
 from prog.rb:3:in `print'
 from prog.rb:3
doc_ruby_on_rails
2015-04-13 10:35:11
Comments
Leave a Comment

Please login to continue.