| Server IP : 162.214.74.102 / Your IP : 216.73.217.46 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/opt/cpanel/ea-ruby24/root/usr/share/ri/system/Open3/ |
Upload File : |
U:RDoc::AnyMethod[iI"
capture3:EFI"Open3#capture3;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"UOpen3.capture3 captures the standard output and the standard error of a command.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"Mstdout_str, stderr_str, status = Open3.capture3([env,] cmd... [, opts])
;T:@format0o;
; [I"GThe arguments env, cmd and opts are passed to Open3.popen3 except ;TI"X<code>opts[:stdin_data]</code> and <code>opts[:binmode]</code>. See Process.spawn.;T@o;
; [I"`If <code>opts[:stdin_data]</code> is specified, it is sent to the command's standard input.;T@o;
; [I"SIf <code>opts[:binmode]</code> is true, internal pipes are set to binary mode.;T@o;
; [I"Examples:;T@o;; [I"%# dot is a command of graphviz.
;TI"graph = <<'End'
;TI" digraph g {
;TI" a -> b
;TI" }
;TI" End
;TI"Idrawn_graph, dot_log = Open3.capture3("dot -v", :stdin_data=>graph)
;TI"
;TI"To, e, s = Open3.capture3("echo abc; sort >&2", :stdin_data=>"foo\nbar\nbaz\n")
;TI"p o #=> "abc\n"
;TI"p e #=> "bar\nbaz\nfoo\n"
;TI"2p s #=> #<Process::Status: pid 32682 exit 0>
;TI"
;TI"L# generate a thumbnail image using the convert command of ImageMagick.
;TI"9# However, if the image is really stored in a file,
;TI"S# system("convert", "-thumbnail", "80", "png:#{filename}", "png:-") is better
;TI".# because of reduced memory consumption.
;TI"^# But if the image is stored in a DB or generated by the gnuplot Open3.capture2 example,
;TI",# Open3.capture3 should be considered.
;TI"#
;TI"gimage = File.read("/usr/share/openclipart/png/animals/mammals/sheep-md-v0.1.png", :binmode=>true)
;TI"qthumbnail, err, s = Open3.capture3("convert -thumbnail 80 png:- png:-", :stdin_data=>image, :binmode=>true)
;TI"if s.success?
;TI"' STDOUT.binmode; print thumbnail
;TI"end;T;
0:
@fileI"lib/open3.rb;T:0@omit_headings_from_table_of_contents_below000[ I"3(*cmd, stdin_data: '', binmode: false, **opts);T@:FI"
Open3;FcRDoc::NormalModule00