Skip to content

Commit e732bfc

Browse files
committed
doc update. [ruby-talk:186294]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 5395d14 commit e732bfc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

io.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2149,6 +2149,9 @@ rb_io_close(io)
21492149
* an <code>IOError</code> is raised if such an attempt is made. I/O
21502150
* streams are automatically closed when they are claimed by the
21512151
* garbage collector.
2152+
*
2153+
* If <em>ios</em> is opened by <code>IO.popen</code>,
2154+
* <code>close</code> sets <code>$?</code>.
21522155
*/
21532156

21542157
static VALUE
@@ -3062,7 +3065,9 @@ pipe_open(pstr, pname, mode)
30623065
*
30633066
* If a block is given, Ruby will run the command as a child connected
30643067
* to Ruby with a pipe. Ruby's end of the pipe will be passed as a
3065-
* parameter to the block. In this case <code>IO::popen</code> returns
3068+
* parameter to the block.
3069+
* At the end of block, Ruby close the pipe and sets <code>$?</code>.
3070+
* In this case <code>IO::popen</code> returns
30663071
* the value of the block.
30673072
*
30683073
* If a block is given with a <i>cmd_string</i> of ``<code>-</code>'',
@@ -3078,6 +3083,7 @@ pipe_open(pstr, pname, mode)
30783083
* puts "Parent is #{Process.pid}"
30793084
* IO.popen ("date") { |f| puts f.gets }
30803085
* IO.popen("-") {|f| $stderr.puts "#{Process.pid} is here, f is #{f}"}
3086+
* p $?
30813087
*
30823088
* <em>produces:</em>
30833089
*
@@ -3086,6 +3092,7 @@ pipe_open(pstr, pname, mode)
30863092
* Wed Apr 9 08:53:52 CDT 2003
30873093
* 26169 is here, f is
30883094
* 26166 is here, f is #<IO:0x401b3d44>
3095+
* #<Process::Status: pid=26166,exited(0)>
30893096
*/
30903097

30913098
static VALUE

0 commit comments

Comments
 (0)