別のキーワード
クラス
-
ARGF
. class (24) - CGI (12)
- Dir (130)
- File (36)
- IO (144)
-
Thread
:: SizedQueue (10)
検索結果
先頭5件
-
Thread
:: SizedQueue # close -> self (21176.0) -
キューを close します。詳しくは Thread::Queue#close を参照してください。
... close します。詳しくは Thread::Queue#close を参照してください。
Thread::Queue とはキューにオブジェクトを追加するスレッドの動作が
異なります。キューにオブジェクトを追加するスレッドを待機している場合は
ClosedQueueError が......発生して中断されます。
//emlist[例][ruby]{
q = SizedQueue.new(4)
[:resource1, :resource2, :resource3, nil].each { |r| q.push(r) }
q.closed? # => false
q.close
q.closed? # => true
//}
@see Thread::Queue#close... -
ARGF
. class # close -> self (21144.0) -
現在開いている処理対象のファイルをクローズします。開くファイルが残って いる場合は次のファイルをオープンします。 ただし、標準入力はクローズされません。
..."bar" > bar
$ ruby argf.rb foo bar
ARGF.filename # => "foo"
ARGF.close
ARGF.filename # => "bar"
ARGF.close
ARGF.close # => closed stream (IOError)
@raise IOError 処理対象のファイルが既にクローズされていた場合に発生します。
@see ARGF.class#closed?... -
Dir
# close -> nil (21138.0) -
ディレクトリストリームをクローズします。 以降のディレクトリに対する操作は例外 IOError を発生させます。 クローズに成功すれば nil を返します。
...に対する操作は例外 IOError を発生させます。
クローズに成功すれば nil を返します。
//emlist[例][ruby]{
d = Dir.new(".")
d.close # => nil
//}
@raise IOError close に失敗した場合に発生します。また既に自身が close している場合に発生し... -
ARGF
. class # close -> self (21132.0) -
現在開いている処理対象のファイルをクローズします。開くファイルが残って いる場合は次のファイルをオープンします。 ただし、標準入力はクローズされません。
...いる場合は次のファイルをオープンします。
ただし、標準入力はクローズされません。
$ echo "foo" > foo
$ echo "bar" > bar
$ ruby argf.rb foo bar
ARGF.filename # => "foo"
ARGF.close
ARGF.filename # => "bar"
ARGF.close
@see ARGF.class#closed?... -
IO
# close _ read -> nil (12284.0) -
読み込み用の IO を close します。主にパイプや読み書き両用に作成し た IO オブジェクトで使用します。
...を close します。主にパイプや読み書き両用に作成し
た IO オブジェクトで使用します。
既に close されていた場合には単に無視されます。
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
@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
# close _ write -> nil (12284.0) -
書き込み用の IO を close します。
...用の IO を close します。
既に close されていた場合には単に無視されます。
@raise IOError 自身が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX close に失敗した場合に発生します。
//emlist[例][ruby]{
f = IO.po......pen("/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 _ read -> nil (12278.0) -
読み込み用の IO を close します。主にパイプや読み書き両用に作成し た IO オブジェクトで使用します。
... close します。主にパイプや読み書き両用に作成し
た IO オブジェクトで使用します。
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
@raise Errno::EXXX close に失敗した場合に発生します。
//emlist[例][ru......by]{
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
# close _ write -> nil (12278.0) -
書き込み用の IO を close します。
... close します。
@raise IOError 自身が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX close に失敗した場合に発生します。
//emlist[例][ruby]{
f = IO.popen("/bin/sh","r+") do |f|
f.close_write
# f.print "nowhere" # => IOError: no......t opened for writing
end
//}
@see IO#close, IO#closed?, IO#close_read... -
ARGF
. class # closed? -> bool (9165.0) -
現在開いている処理対象のファイルがARGFがcloseされていればtrueを返します。
...処理対象のファイルがARGFがcloseされていればtrueを返します。
例:
# $ echo "foo" > foo
# $ echo "bar" > bar
# $ ruby argf.rb foo bar
ARGF.filename # => "foo"
ARGF.close
# 複数のファイルを開いているので1度のARGF.closeではまた全てのファイ......ルを閉じていないのでfalseになる
ARGF.closed? # => false
ARGF.filename # => "bar"
ARGF.close
# 2つのファイルを開いていたので2度目のARGF.closeで全てのファイルを閉じたためtrueになる
ARGF.closed? # => true
@see IO#closed?, ARGF.class#close... -
IO
# closed? -> bool (6161.0) -
self が完全に(読み込み用と書き込み用の両方が)クローズされている場合に true を返します。 そうでない場合は false を返します。
...に true を返します。
そうでない場合は false を返します。
//emlist[例][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
# reopen(path) -> self (6158.0) -
path で指定されたファイルにストリームを繋ぎ換えます。
...o などはリセットされます。
@param path パスを表す文字列を指定します。
@param mode パスを開く際のモードを文字列で指定します。
@raise Errno::EXXX 失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThi......f1.print("This is line three\n")
f2.readlines # => ["This is line one\n", "This is line two\n"]
f1.close
f2.reopen("testfile", "r") # => #<File:testfile>
f2.readlines # => ["This is line one\n", "This is line two\n", "This is line three\n"]
f2.close
//}
@see Kernel.#... -
IO
# reopen(path , mode) -> self (6158.0) -
path で指定されたファイルにストリームを繋ぎ換えます。
...o などはリセットされます。
@param path パスを表す文字列を指定します。
@param mode パスを開く際のモードを文字列で指定します。
@raise Errno::EXXX 失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThi......f1.print("This is line three\n")
f2.readlines # => ["This is line one\n", "This is line two\n"]
f1.close
f2.reopen("testfile", "r") # => #<File:testfile>
f2.readlines # => ["This is line one\n", "This is line two\n", "This is line three\n"]
f2.close
//}
@see Kernel.#... -
CGI
# header(options = "text / html") -> String (6143.0) -
HTTP ヘッダを options に従って生成します。 CGI#out と違い、標準出力には出力しません。 CGI#out を使わずに自力で HTML を出力したい場合などに使います。 このメソッドは文字列エンコーディングを変換しません。
...ext/html" です。
: charset
ボディのキャラクタセットを Content-Type ヘッダに追加します。
: nph
真偽値を指定します。真ならば、HTTP のバージョン、ステータスコード、
Date ヘッダをセットします。また Server と Connection の各......定します。
このリストの下に利用可能なステータスコードのリストがあります。
: server
サーバソフトウェアの名称指定します。Server ヘッダに対応します。
: connection
接続の種類を指定します。Connection ヘッダに対応し......ンテンツの言語を指定します。Content-Language ヘッダに対応します。
: expires
送信するコンテンツの有効期限を Time のインスタンスで指定します。
Expires ヘッダに対応します。
: cookie
クッキーとして文字列か CGI::Cookie のイ...