24件ヒット
  
    
      [1-24件を表示]
    
  
    (0.693秒)
  
  
    トップページ > 
:Kernel.#p
 > 
:rectangular
 > 
:String
 > 
:cpp_command
 > 
:public_instance_method
 > 
:method
 > 
:lambda
 > 
:write
 > 
:Open3
  
ライブラリ
- open3 (24)
 
検索結果
先頭2件
- 
      
Open3
. # popen3(*cmd) -> [IO , IO , IO , Thread] (9149.0)  - 
      
      
      
外部プログラム cmd を実行し、そのプロセスの標準入力、標準出力、標準エラー 出力に接続されたパイプと実行したプロセスを待つためのスレッドを 4 要素の 配列で返します。
...ロセスを待つためのスレッドを 4 要素の
配列で返します。
//emlist[][ruby]{
require 'open3'
stdin, stdout, stderr, wait_thr = *Open3.popen3("/usr/bin/nroff -man")
//}
@param cmd 実行するコマンドを指定します。
@return ブロックを指定した場合はブロ......式の結果を返します。
//emlist[][ruby]{
require 'open3'
Open3.popen3("read stdin; echo stdout; echo stderr >&2") {|stdin, stdout, stderr, wait_thr|
stdin.puts "stdin"
stdin.close # または close_write
p stdout.read
p stderr.read
}
# => "stdout\n"
# "stderr\n"
//}
stdin......きる限り早く close か close_write
で閉じるべきです。
[UNIX系OS固有の注意] Open3 で作成した子プロセスは
wait(2) しなくてもゾンビになりません。
引数 cmd はそのまま Kernel.#spawn に渡されます。
Kernel.#spawnと同様に、引数リスト... - 
      
Open3
. # popen3(*cmd) {|stdin , stdout , stderr , wait _ thr| . . . } -> () (9149.0)  - 
      
      
      
外部プログラム cmd を実行し、そのプロセスの標準入力、標準出力、標準エラー 出力に接続されたパイプと実行したプロセスを待つためのスレッドを 4 要素の 配列で返します。
...ロセスを待つためのスレッドを 4 要素の
配列で返します。
//emlist[][ruby]{
require 'open3'
stdin, stdout, stderr, wait_thr = *Open3.popen3("/usr/bin/nroff -man")
//}
@param cmd 実行するコマンドを指定します。
@return ブロックを指定した場合はブロ......式の結果を返します。
//emlist[][ruby]{
require 'open3'
Open3.popen3("read stdin; echo stdout; echo stderr >&2") {|stdin, stdout, stderr, wait_thr|
stdin.puts "stdin"
stdin.close # または close_write
p stdout.read
p stderr.read
}
# => "stdout\n"
# "stderr\n"
//}
stdin......きる限り早く close か close_write
で閉じるべきです。
[UNIX系OS固有の注意] Open3 で作成した子プロセスは
wait(2) しなくてもゾンビになりません。
引数 cmd はそのまま Kernel.#spawn に渡されます。
Kernel.#spawnと同様に、引数リスト... 
