るりまサーチ

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

別のキーワード

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

ライブラリ

検索結果

IO.binread(path, length = nil, offset = 0) -> String | nil (8018.0)

path で指定したファイルを open し、offset の所まで seek し、 length バイト読み込みます。

...path で指定したファイルを open し、offset の所まで seek し、
length バイト読み込みます。

Kernel.#open と同様 path の先頭が "|" ならば、"|" に続くコマンドの出力を読み取ります。

length を省略するとファイルの末尾まで読み込み...
...ist[例][ruby]{
IO
.write("testfile", "This is line one\nThis is line two\nThis is line three\nAnd so on...\n")
IO
.binread("testfile") # => "This is line one\nThis is line two\nThis is line three\nAnd so on...\n"
IO
.binread("testfile", 20) # => "This is line one\nThi"
IO
.binread("test...
...file", 20, 10) # => "ne one\nThis is line "
//}

@see IO.read...