るりまサーチ

最速Rubyリファレンスマニュアル検索!
408件ヒット [401-408件を表示] (0.011秒)
トップページ > クラス:IO[x] > 種類:特異メソッド[x] > クエリ:read[x]

別のキーワード

  1. _builtin read
  2. stringio read
  3. io read
  4. csv read
  5. tuple read

ライブラリ

キーワード

検索結果

<< < ... 3 4 5 >>

IO.popen(env, "-", mode = "r", opt={}) {|io| ... } -> object (5.0)

第一引数に文字列 "-" が指定された時、fork(2) を 行い子プロセスの標準入出力との間にパイプラインを確立します。 親プロセスでは IO オブジェクトを返し、子プロセスでは nil を返します。

...ンを確立します。
親プロセスでは IO オブジェクトを返し、子プロセスでは
nil を返します。

io
= IO.popen("-", "r+")
if io # parent
io
.puts "foo"
p io.gets # => "child output: foo\n"
io
.close
else # child
s = gets
print...
... IO オブジェクトを引数に
ブロックを実行し、その結果を返します。ブロックの実行後、生成したパイ
プは自動的にクローズされます。
子プロセスでは nil を引数にブロックを実行し終了します。

p IO.popen("-", "r+") {|io|...
...if io # parent
io
.puts "foo"
io
.gets
else # child
s = gets
puts "child output: " + s
end
}
# => "child output: foo\n"

opt ではエンコーディングの設定やプロセス起動のためのオプションが指定できます。
IO
.new や Kernel.#spa...
<< < ... 3 4 5 >>