Method: Dir#pos=

Defined in:
dir.c

#pos=(position) ⇒ Integer

Sets the position in self and returns position. The value of position should have been returned from an earlier call to #tell; if not, the return values from subsequent calls to #read are unspecified.

See Dir As Stream-Like.

Examples:

dir = Dir.new('example')
dir.pos      # => 0
dir.pos = 3  # => 3
dir.pos      # => 3
dir.pos = 30 # => 30
dir.pos      # => 5

Returns:



1059
1060
1061
1062
1063
1064
# File 'dir.c', line 1059

static VALUE
dir_set_pos(VALUE dir, VALUE pos)
{
    dir_seek(dir, pos);
    return pos;
}