End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Dir#tell
dir.tell → integer
dir.c
View on GitHub ↗
static VALUE
dir_tell(VALUE dir)
{
struct dir_data *dirp;
long pos;
GetDIR(dir, dirp);
pos = telldir(dirp->dir);
return rb_int2inum(pos);
}
Returns the current position in dir. See also Dir#seek.
Example
d = Dir.new("testdir") d.tell #=> 0 d.read #=> "." d.tell #=> 12