るりまサーチ

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

クラス

  • IO (198)

キーワード

検索結果

<< 1 2 > >>

IO#close_write -> nil (26208.0)

書き込み用の IO を close します。

...ンされていなければ発生します。

@raise Errno::EXXX close に失敗した場合に発生します。

//emlist[例][ruby]{
f = IO.popen("/bin/sh","r+") do |f|
f.close_write
# f.print "nowhere" # => IOError: not opened for writing
end
//}

@see IO#close, IO#closed?, IO#close_read...

IO#close -> nil (8107.0)

入出力ポートをクローズします。

...IOError 既に close されていた場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "test")
f = File.open("testfile")
f.read # => "test"
f.close
# f.read # => IOError (すでに close しているので read できない)
//}

@see IO#closed?, IO#close_read, IO#close_write...
...se Errno::EXXX close に失敗した場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "test")
f = File.open("testfile")
f.read # => "test"
f.close
# f.read # => IOError (すでに close しているので read できない)
//}

@see IO#closed?, IO#close_read, IO#close_write...

IO#close_read -> nil (8107.0)

読み込み用の IO を close します。主にパイプや読み書き両用に作成し た IO オブジェクトで使用します。

...オープンされていなければ発生します。

@raise Errno::EXXX close に失敗した場合に発生します。

//emlist[例][ruby]{
IO.popen("/bin/sh","r+") do |f|
f.close_read
# f.readlines # => IOError: not opened for reading
end
//}

@see IO#close, IO#closed?, IO#close_write...

IO#closed? -> bool (8030.0)

self が完全に(読み込み用と書き込み用の両方が)クローズされている場合に true を返します。 そうでない場合は false を返します。

...例][ruby]{
IO.write("testfile", "test")
f = File.new("testfile")
f.close # => nil
f.closed? # => true
f = IO.popen("/bin/sh","r+")
f.close_write # => nil
f.closed? # => false
f.close_read # => nil
f.closed? # => true
//}

@see IO#close, IO#close_read, IO#close_write...

IO.popen("-", mode = "r", opt={}) -> IO (8024.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....
...、その結果を返します。ブロックの実行後、生成したパイ
プは自動的にクローズされます。
子プロセスでは nil を引数にブロックを実行し終了します。

p IO.popen("-", "r+") {|io|
if io # parent
io.puts "foo"
io.gets
el...

絞り込み条件を変える

IO.popen("-", mode = "r", opt={}) {|io| ... } -> object (8024.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....
...、その結果を返します。ブロックの実行後、生成したパイ
プは自動的にクローズされます。
子プロセスでは nil を引数にブロックを実行し終了します。

p IO.popen("-", "r+") {|io|
if io # parent
io.puts "foo"
io.gets
el...

IO.popen(env, "-", mode = "r", opt={}) -> IO (8024.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....
...、その結果を返します。ブロックの実行後、生成したパイ
プは自動的にクローズされます。
子プロセスでは nil を引数にブロックを実行し終了します。

p IO.popen("-", "r+") {|io|
if io # parent
io.puts "foo"
io.gets
el...

IO.popen(env, "-", mode = "r", opt={}) {|io| ... } -> object (8024.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....
...、その結果を返します。ブロックの実行後、生成したパイ
プは自動的にクローズされます。
子プロセスでは nil を引数にブロックを実行し終了します。

p IO.popen("-", "r+") {|io|
if io # parent
io.puts "foo"
io.gets
el...

IO.popen([env = {}, [cmdname, arg0], *args, execopt={}], mode = "r", opt={}) -> IO (8014.0)

サブプロセスを実行し、そのプロセスの標準入出力 との間にパイプラインを確立します。生成したパイプを IO オブジェクトとして返します。

...。生成したパイプを IO オブジェクトとして返します。

p io = IO.popen("cat", "r+") # => #<IO:fd 4>
io.puts "foo"
io.close_write
p io.gets # => "foo\n"

サブプロセスを指定する方法は2通りあります。文字列を指定する場合と...
...ックの実行後、生成したパイ
プは自動的にクローズされます。

p IO.popen("cat", "r+") {|io|
io.puts "foo"
io.close_write
io.gets
}
# => "foo\n"


opt でプロセス起動のためのオプションや、パイプ IO オブジェクトの属性(エンコー...

IO.popen([env = {}, [cmdname, arg0], *args, execopt={}], mode = "r", opt={}) {|f| ... } -> object (8014.0)

サブプロセスを実行し、そのプロセスの標準入出力 との間にパイプラインを確立します。生成したパイプを IO オブジェクトとして返します。

...。生成したパイプを IO オブジェクトとして返します。

p io = IO.popen("cat", "r+") # => #<IO:fd 4>
io.puts "foo"
io.close_write
p io.gets # => "foo\n"

サブプロセスを指定する方法は2通りあります。文字列を指定する場合と...
...ックの実行後、生成したパイ
プは自動的にクローズされます。

p IO.popen("cat", "r+") {|io|
io.puts "foo"
io.close_write
io.gets
}
# => "foo\n"


opt でプロセス起動のためのオプションや、パイプ IO オブジェクトの属性(エンコー...

絞り込み条件を変える

<< 1 2 > >>