33件ヒット
[1-33件を表示]
(0.183秒)
検索結果
先頭3件
-
Open3
. # popen3(*cmd) -> [IO , IO , IO , Thread] (18574.0) -
外部プログラム cmd を実行し、そのプロセスの標準入力、標準出力、標準エラー 出力に接続されたパイプと実行したプロセスを待つためのスレッドを 4 要素の 配列で返します。
...と実行したプロセスを待つためのスレッドを 4 要素の
配列で返します。
require 'open3'
stdin, stdout, stderr, wait_thr = *Open3.popen3("/usr/bin/nroff -man")
@param cmd 実行するコマンドを指定します。
@return ブロックを指定した場合はブロ......返します。
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 への入力が終わ......) {|i, o, e, t|
i.close
print o.read
}
#=> ...
foo=1
bar=2
Kernel.#spawnと同様に、引数リストの最後にオプションをハッシュ形式
で指定する事ができます。
例:
require "open3"
# オプションを指定した場合。
Dir.chdir("/t... -
Open3
. # popen3(*cmd) {|stdin , stdout , stderr , wait _ thr| . . . } -> () (18374.0) -
外部プログラム cmd を実行し、そのプロセスの標準入力、標準出力、標準エラー 出力に接続されたパイプと実行したプロセスを待つためのスレッドを 4 要素の 配列で返します。
...と実行したプロセスを待つためのスレッドを 4 要素の
配列で返します。
require 'open3'
stdin, stdout, stderr, wait_thr = *Open3.popen3("/usr/bin/nroff -man")
@param cmd 実行するコマンドを指定します。
@return ブロックを指定した場合はブロ......返します。
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 への入力が終わ......) {|i, o, e, t|
i.close
print o.read
}
#=> ...
foo=1
bar=2
Kernel.#spawnと同様に、引数リストの最後にオプションをハッシュ形式
で指定する事ができます。
例:
require "open3"
# オプションを指定した場合。
Dir.chdir("/t... -
ruby 1
. 6 feature (4434.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...ature
ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン
になります。
((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。
== 1.6.8 (2002-12-24) -> stable-sna......xt/plain; charset=iso-8859-1
^M
TEXT_PLAIN: text/plain; charset=iso-8859-1
TEXT_PLAIN: text/plain
=> ruby 1.6.5 (2001-09-19) [i586-linux]
Content-Type: text/plain; charset=iso-8859-1
^M
TEXT_PLAIN: text/plain
: Dir.chdir......3 (2001-03-19) [i586-linux]
[[1], [2], [3]]
# => ruby 1.6.4 (2001-06-04) [i586-linux]
[1, 2, 3]
: $SAFE / alias
$SAFE = 4 のときグローバル変数のエイリアスを許さないようにしました。
((<ruby-dev:13287>))
: ((<open3/Open3.popen3>))
終了し...