summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-03-28 01:49:32 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-03-28 01:49:32 +0000
commite732bfca12ab68164bdd0c212345edded9248402 (patch)
tree80abd219097295721e830ae5f0542e0c76b2e125 /io.c
parent5395d144d354449cd85a0b19125cc12428272471 (diff)
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
Diffstat (limited to 'io.c')
-rw-r--r--io.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/io.c b/io.c
index 0481a8a6b2..b3f5135c45 100644
--- a/io.c
+++ b/io.c
@@ -2149,6 +2149,9 @@ rb_io_close(io)
* an <code>IOError</code> is raised if such an attempt is made. I/O
* streams are automatically closed when they are claimed by the
* garbage collector.
+ *
+ * If <em>ios</em> is opened by <code>IO.popen</code>,
+ * <code>close</code> sets <code>$?</code>.
*/
static VALUE
@@ -3062,7 +3065,9 @@ retry:
*
* If a block is given, Ruby will run the command as a child connected
* to Ruby with a pipe. Ruby's end of the pipe will be passed as a
- * parameter to the block. In this case <code>IO::popen</code> returns
+ * parameter to the block.
+ * At the end of block, Ruby close the pipe and sets <code>$?</code>.
+ * In this case <code>IO::popen</code> returns
* the value of the block.
*
* If a block is given with a <i>cmd_string</i> of ``<code>-</code>'',
@@ -3078,6 +3083,7 @@ retry:
* puts "Parent is #{Process.pid}"
* IO.popen ("date") { |f| puts f.gets }
* IO.popen("-") {|f| $stderr.puts "#{Process.pid} is here, f is #{f}"}
+ * p $?
*
* <em>produces:</em>
*
@@ -3086,6 +3092,7 @@ retry:
* Wed Apr 9 08:53:52 CDT 2003
* 26169 is here, f is
* 26166 is here, f is #<IO:0x401b3d44>
+ * #<Process::Status: pid=26166,exited(0)>
*/
static VALUE