seek(p1)
public
Seeks to a particular location in dir. integer must be a
value returned by Dir#tell.
d = Dir.new("testdir")
d.read
i = d.tell
d.read
d.seek(i)
d.read
Show source
/*
* call-seq:
* dir.seek( integer ) => dir
*
* Seeks to a particular location in <em>dir</em>. <i>integer</i>
* must be a value returned by <code>Dir#tell</code>.
*
* d = Dir.new("testdir")
* d.read
* i = d.tell
* d.read
* d.seek(i)
* d.read
*/
static VALUE
dir_seek(dir, pos)
VALUE dir, pos;
{
struct dir_data *dirp;
off_t p = NUM2OFFT(pos);
GetDIR(dir, dirp);
#ifdef HAVE_SEEKDIR
seekdir(dirp->dir, p);
return dir;
#else
rb_notimplement();
#endif
}