るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.076秒)
トップページ > クエリ:-[x] > クエリ:@[x] > クエリ:pipeline_rw[x]

別のキーワード

  1. open3 pipeline_rw
  2. open3 pipeline_w
  3. open3 pipeline_r
  4. open3 pipeline_start
  5. open3 pipeline

ライブラリ

モジュール

検索結果

Open3.#pipeline_rw(*cmds) -> [IO, IO, [Thread]] (18238.0)

指定したコマンドのリストをパイプで繋いで順番に実行します。最初の コマンドの標準入力に書き込む事も最後のコマンドの標準出力を受けとる事も できます。

...けとる事も
できます。

@
param cmds 実行するコマンドのリストを指定します。それぞれのコマンドは
以下のように String か Array で指定します。
commandline にはコマンド全体(例. "nroff -man")を表す
String...
...commandline, options]
(3) [env, commandline, options]
(4) [env, cmdname, arg1, arg2, ..., options]
(5) [env, [cmdname, argv0], arg1, ..., options]

@
return ブロックを指定した場合はブロックの最後に評価された値を返します。
ブロックを指定しなかった...
...実行したプロセスを待つため
のスレッドの配列を配列で返します。

例:

require "open3"

Open3.pipeline_rw("sort", "cat -n") {|stdin, stdout, wait_thrs|
stdin.puts "foo"
stdin.puts "bar"
stdin.puts "baz"

# sortコマンドにEOFを送る...

Open3.#pipeline_rw(*cmds) {|first_stdin, last_stdout, wait_thrs| ... } -> () (18238.0)

指定したコマンドのリストをパイプで繋いで順番に実行します。最初の コマンドの標準入力に書き込む事も最後のコマンドの標準出力を受けとる事も できます。

...けとる事も
できます。

@
param cmds 実行するコマンドのリストを指定します。それぞれのコマンドは
以下のように String か Array で指定します。
commandline にはコマンド全体(例. "nroff -man")を表す
String...
...commandline, options]
(3) [env, commandline, options]
(4) [env, cmdname, arg1, arg2, ..., options]
(5) [env, [cmdname, argv0], arg1, ..., options]

@
return ブロックを指定した場合はブロックの最後に評価された値を返します。
ブロックを指定しなかった...
...実行したプロセスを待つため
のスレッドの配列を配列で返します。

例:

require "open3"

Open3.pipeline_rw("sort", "cat -n") {|stdin, stdout, wait_thrs|
stdin.puts "foo"
stdin.puts "bar"
stdin.puts "baz"

# sortコマンドにEOFを送る...