4件ヒット
[1-4件を表示]
(0.045秒)
検索結果
先頭4件
-
IO
. select(reads , writes = [] , excepts = [] , timeout = nil) -> [[IO]] | nil (940.0) -
select(2) を実行します。
...られた入力/出力/例外待ちの IO オブジェクトの中から準備ができたものを
それぞれ配列にして、配列の配列として返します。
タイムアウトした時には nil を返します。
@param reads 入力待ちする IO オブジェクトの配列を渡し......ます。
@param writes 出力待ちする IO オブジェクトの配列を渡します。
@param excepts 例外待ちする IO オブジェクトの配列を渡します。
@param timeout タイムアウトまでの時間を表す数値または nil を指定します。数値で指定したと......定した時には IO がどれかひとつレディ状態になるまで待ち続けます。
@raise IOError 与えられた IO オブジェクトが閉じられていた時に発生します。
@raise Errno::EXXX select(2) に失敗した場合に発生します。
rp, wp = IO.pipe
mesg = "pi... -
IO
# readlines(limit , chomp: false) -> [String] (370.0) -
データを全て読み込んで、その各行を要素としてもつ配列を返します。 既に EOF に達していれば空配列 [] を返します。
...@param chomp true を指定すると各行の末尾から rs を取り除きます。
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
//emlist[例][ruby]{
IO.write("testfile", "line1,\nline2,\nline3,\n")
File.open("testfile") { |f| p f.readlines }......chomp = true)][ruby]{
IO.write("testfile", "line1,\rline2,\r\nline3,\n")
File.open("testfile") { |f| p f.readlines(chomp: true) } # => ["line1,\rline2,", "line3,"]
File.open("testfile") { |f| p f.readlines("\r", chomp: true) } # => ["line1,", "line2,", "\nline3,\n"]
//}
@see $/, IO#gets... -
IO
# readlines(rs = $ / , chomp: false) -> [String] (370.0) -
データを全て読み込んで、その各行を要素としてもつ配列を返します。 既に EOF に達していれば空配列 [] を返します。
...@param chomp true を指定すると各行の末尾から rs を取り除きます。
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
//emlist[例][ruby]{
IO.write("testfile", "line1,\nline2,\nline3,\n")
File.open("testfile") { |f| p f.readlines }......chomp = true)][ruby]{
IO.write("testfile", "line1,\rline2,\r\nline3,\n")
File.open("testfile") { |f| p f.readlines(chomp: true) } # => ["line1,\rline2,", "line3,"]
File.open("testfile") { |f| p f.readlines("\r", chomp: true) } # => ["line1,", "line2,", "\nline3,\n"]
//}
@see $/, IO#gets... -
IO
# readlines(rs , limit , chomp: false) -> [String] (370.0) -
データを全て読み込んで、その各行を要素としてもつ配列を返します。 既に EOF に達していれば空配列 [] を返します。
...@param chomp true を指定すると各行の末尾から rs を取り除きます。
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
//emlist[例][ruby]{
IO.write("testfile", "line1,\nline2,\nline3,\n")
File.open("testfile") { |f| p f.readlines }......chomp = true)][ruby]{
IO.write("testfile", "line1,\rline2,\r\nline3,\n")
File.open("testfile") { |f| p f.readlines(chomp: true) } # => ["line1,\rline2,", "line3,"]
File.open("testfile") { |f| p f.readlines("\r", chomp: true) } # => ["line1,", "line2,", "\nline3,\n"]
//}
@see $/, IO#gets...