Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

Dir#pos

pos

Alias of #tell

Returns the current position of self; see Dir As Stream-Like:

Example
dir = Dir.new('example')
dir.tell  # => 0
dir.read  # => "."
dir.tell  # => 1
See also #tell #pos= #path #inspect also in 4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0