504件ヒット
[1-100件を表示]
(0.081秒)
クラス
-
ARGF
. class (72) - Array (84)
-
File
:: Stat (24) - IO (108)
- Integer (96)
- Object (12)
- Range (24)
- String (24)
モジュール
- Enumerable (60)
キーワード
- <=> (12)
- [] (24)
- chunk (12)
-
close
_ write (12) - cycle (48)
- downto (24)
- each (24)
-
each
_ char (48) -
each
_ codepoint (24) -
each
_ entry (24) - fetch (36)
-
inplace
_ mode (12) -
inplace
_ mode= (12) - printf (24)
- reopen (36)
-
reverse
_ each (24) - size? (12)
- sysseek (12)
- times (24)
-
to
_ s (12) - upto (24)
検索結果
先頭5件
-
IO
# print(*arg) -> nil (24222.0) -
引数を IO ポートに順に出力します。引数を省略した場合は、$_ を出力します。
...param arg Kernel.#print と同じです。
@raise IOError 自身が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX 出力に失敗した場合に発生します。
//emlist[例][ruby]{
$stdout.print("This is ", 100, " percent.\n") # => This is 100 perce......nt.
//}
@see Kernel.#print... -
ARGF
. class # print(*arg) -> nil (24210.0) -
引数を順に処理対象のファイルに出力します。
...引数を順に処理対象のファイルに出力します。
c:ARGF#inplace時にのみ使用できます。
また $stdout への代入の影響を受けません。
それ以外は Kernel.#print と同じです。
@param arg 出力するオブジェクトを任意個指定します。... -
IO
# printf(format , *arg) -> nil (12209.0) -
C 言語の printf と同じように、format に従い引数 を文字列に変換して、self に出力します。
... printf と同じように、format に従い引数
を文字列に変換して、self に出力します。
第一引数に IO を指定できないこと、引数を省略できないことを除けば Kernel.#printf と同じです。
@param format Kernel.#printf と同じです。print_format......を参照してください。
@param arg Kernel.#printf と同じです。
@raise IOError 自身が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX 出力に失敗した場合に発生します。
@see Kernel.#printf... -
ARGF
. class # printf(format , *arg) -> nil (12203.0) -
C 言語の printf と同じように、format に従い引数を 文字列に変換して処理対象のファイルに出力します。
... printf と同じように、format に従い引数を
文字列に変換して処理対象のファイルに出力します。
c:ARGF#inplace時にのみ使用できます。
また $stdout への代入の影響を受けません。
それ以外は出力先を指定しない形式の Kernel.#print......f と同じです。
@param format フォーマット文字列です。
@param arg フォーマットされる引数です。... -
IO
# each _ char -> Enumerator (6209.0) -
self に含まれる文字を一文字ずつブロックに渡して評価します。
...ません。
ブロックを省略した場合は各文字について繰り返す Enumerator を返します。
@raise IOError self が読み込み用にオープンされていない場合に発生します。
f = File.new("testfile")
f.each_char {|c| print c, ' ' } #=> #<File:testfile>... -
String
# each _ char -> Enumerator (6209.0) -
文字列の各文字に対して繰り返します。
...文字列の各文字に対して繰り返します。
たとえば、
//emlist[][ruby]{
"hello世界".each_char {|c| print c, ' ' }
//}
は次のように出力されます。
h e l l o 世 界
@see String#chars... -
IO
# close _ write -> nil (6115.0) -
書き込み用の IO を close します。
...@raise IOError 自身が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX close に失敗した場合に発生します。
//emlist[例][ruby]{
f = IO.popen("/bin/sh","r+") do |f|
f.close_write
# f.print "nowhere" # => IOError: not opened for writin......g
end
//}
@see IO#close, IO#closed?, IO#close_read......@raise IOError 自身が書き込み用にオープンされていなければ発生します。
@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
# reopen(path) -> self (6115.0) -
path で指定されたファイルにストリームを繋ぎ換えます。
...などはリセットされます。
@param path パスを表す文字列を指定します。
@param mode パスを開く際のモードを文字列で指定します。
@raise Errno::EXXX 失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis......)
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 (6115.0) -
path で指定されたファイルにストリームを繋ぎ換えます。
...などはリセットされます。
@param path パスを表す文字列を指定します。
@param mode パスを開く際のモードを文字列で指定します。
@raise Errno::EXXX 失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis......)
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....