summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-03 12:18:50 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-03 12:18:50 +0000
commit454de1d5eb178ae71397702702fbda4996196f65 (patch)
tree19333c696722f4e9ee3dd433d57182daf9bbe37b /lib
parentf9e9eee677e8196da7288f4ab7754ebe345d7ed9 (diff)
update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/open3.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/open3.rb b/lib/open3.rb
index 03a7937c09..7f68d706e9 100644
--- a/lib/open3.rb
+++ b/lib/open3.rb
@@ -70,6 +70,15 @@ module Open3
#
# Closing stdin, stdout and stderr does not wait the process.
#
+ # You should be careful to avoid deadlocks.
+ # Since pipes are fixed length buffer,
+ # Open3.popen3("prog") {|i, o, e, t| o.read } deadlocks if
+ # the program generates many output on stderr.
+ # You should be read stdout and stderr simultaneously (using thread or IO.select).
+ # However if you don't need stderr output, Open3.popen2 can be used.
+ # If merged stdout and stderr output is not a problem, you can use Open3.popen2e.
+ # If you really needs stdout and stderr output as separate strings, you can consider Open3.capture3.
+ #
def popen3(*cmd, &block)
if Hash === cmd.last
opts = cmd.pop.dup