るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.022秒)
トップページ > クラス:IO[x] > クエリ:open[x] > クエリ:io#seek[x] > クエリ:pos=[x]

別のキーワード

  1. << rexml::attribute#name
  2. add rexml::attribute#name
  3. inspect? irb::context#inspect_mode
  4. inspect? irb::context#inspect_mode=
  5. handle_interrupt thread#raise

ライブラリ

検索結果

IO#pos=(n) (18129.0)

ファイルポインタを指定位置に移動します。 IO#seek(n, IO::SEEK_SET) と同じです。

...ます。
IO#seek
(n, IO::SEEK_SET) と同じです。

@param n 先頭からのオフセットを整数で指定します。

@raise IOError 既に close されている場合に発生します。

//emlist[例][ruby]{
IO
.write("testfile", "This is line one\nThis is line two\n")
File.open("testfile"...
...) do |f|
f.pos # => 0
f.pos = 17
f.gets # => "This is line two\n"
end
//}...