close_read

ios.close_read â nil
Instance Public methods

Closes the read 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.

1
2
3
f = IO.popen("/bin/sh","r+")
f.close_read
f.readlines

produces:

1
2
prog.rb:3:in `readlines': not opened for reading (IOError)
 from prog.rb:3
doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.