るりまサーチ

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

別のキーワード

  1. dir open
  2. dir chdir
  3. dir foreach
  4. dir each_child
  5. rake original_dir

モジュール

検索結果

Open3.#popen3(*cmd) -> [IO, IO, IO, Thread] (14.0)

外部プログラム cmd を実行し、そのプロセスの標準入力、標準出力、標準エラー 出力に接続されたパイプと実行したプロセスを待つためのスレッドを 4 要素の 配列で返します。

...たパイプと実行したプロセスを待つためのスレッドを 4 要素の
配列で返します。

require 'open3'
stdin, stdout, stderr, wait_thr = *Open3.popen3("/usr/bin/nroff -man")

@param cmd 実行するコマンドを指定します。

@return ブロックを指定した場...
...を実行し、最後にパイプ
を close します。この場合はブロックの最後の式の結果を返します。

require 'open3'

Open3
.popen3("read stdin; echo stdout; echo stderr >&2") {|stdin, stdout, stderr, wait_thr|
stdin.puts "stdin"
stdin.close # または close...
...きます。

例:

require "open3"

# オプションを指定した場合。
Dir
.chdir("/tmp")
Open3
.popen3("pwd", :chdir=> "/") {|i,o,e,t|
p o.read.chomp #=> "/"
}

# オプションを指定しない場合。
Dir
.chdir("/tmp")
Open3
.popen3("pwd") {|i,o,e,t|
p o.read.c...

Open3.#popen3(*cmd) {|stdin, stdout, stderr, wait_thr| ... } -> () (14.0)

外部プログラム cmd を実行し、そのプロセスの標準入力、標準出力、標準エラー 出力に接続されたパイプと実行したプロセスを待つためのスレッドを 4 要素の 配列で返します。

...たパイプと実行したプロセスを待つためのスレッドを 4 要素の
配列で返します。

require 'open3'
stdin, stdout, stderr, wait_thr = *Open3.popen3("/usr/bin/nroff -man")

@param cmd 実行するコマンドを指定します。

@return ブロックを指定した場...
...を実行し、最後にパイプ
を close します。この場合はブロックの最後の式の結果を返します。

require 'open3'

Open3
.popen3("read stdin; echo stdout; echo stderr >&2") {|stdin, stdout, stderr, wait_thr|
stdin.puts "stdin"
stdin.close # または close...
...きます。

例:

require "open3"

# オプションを指定した場合。
Dir
.chdir("/tmp")
Open3
.popen3("pwd", :chdir=> "/") {|i,o,e,t|
p o.read.chomp #=> "/"
}

# オプションを指定しない場合。
Dir
.chdir("/tmp")
Open3
.popen3("pwd") {|i,o,e,t|
p o.read.c...