22件ヒット
[1-22件を表示]
(0.051秒)
検索結果
-
IO
# seek(offset , whence = IO :: SEEK _ SET) -> 0 (26250.0) -
ファイルポインタを whence の位置から offset だけ移動させます。 offset 位置への移動が成功すれば 0 を返します。
...::SEEK_SET: ファイルの先頭から (デフォルト)
* IO::SEEK_CUR: 現在のファイルポインタから
* IO::SEEK_END: ファイルの末尾から
* IO::SEEK_DATA: offset 以降の次にデータがある位置へ(lseek の man ページ参照。Linux 3.1 以降のみ)
* IO::SEEK_......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... -
Kernel
$ $ stdin -> object (8012.0) -
標準入力です。
...なければいけません。
gets, readline, readlines, getc, readchar, tell, seek,
pos=, rewind, fileno, to_io, eof, each_line, each_byte,
binmode, closed?
//emlist[例][ruby]{
$stdin = Object.new
def $stdin.gets
"foo"
end
p gets() # => "foo"
//}
自プロセスだけでなく...