2件ヒット
[1-2件を表示]
(0.023秒)
別のキーワード
種類
- インスタンスメソッド (1)
- 特異メソッド (1)
ライブラリ
- ビルトイン (2)
検索結果
先頭2件
-
IO
# seek(offset , whence = IO :: SEEK _ SET) -> 0 (118183.0) -
ファイルポインタを whence の位置から offset だけ移動させます。 offset 位置への移動が成功すれば 0 を返します。
...* IO::SEEK_SET: ファイルの先頭から (デフォルト)
* IO::SEEK_CUR: 現在のファイルポインタから
* IO::SEEK_END: ファイルの末尾から
* IO::SEEK_DATA: offset 以降の次にデータがある位置へ(lseek の man ページ参照。Linux 3.1 以降のみ)
* IO::......no::EXXX ファイルポインタの移動に失敗した場合に発生します。
@raise IOError 既に close されていた場合に発生します。
f = File.new("testfile")
f.seek(-13, IO::SEEK_END) #=> 0
f.readline #=> "And so on...\n"
@see IO#sysseek... -
IO
. binread(path , length = nil , offset = 0) -> String | nil (63178.0) -
path で指定したファイルを open し、offset の所まで seek し、 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...