Ruby 2.2.0 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > ARGF.classクラス > pos

instance method ARGF.class#pos

pos -> Integer[permalink][rdoc]
tell -> Integer

ARGFが現在開いているファイルのファイルポインタの現在の位置をバイト単位 の整数で返します。

ARGF.pos    # => 0
ARGF.gets   # => "This is line one\n"
ARGF.pos    # => 17

[SEE_ALSO] IO#pos, IO#tell, ARGF.class#pos=