rewind()
public
Show source
/*
* call-seq:
* dir.rewind => dir
*
* Repositions <em>dir</em> to the first entry.
*
* d = Dir.new("testdir")
* d.read
* d.rewind
* d.read
*/
static VALUE
dir_rewind(dir)
VALUE dir;
{
struct dir_data *dirp;
if (rb_safe_level() >= 4 && !OBJ_TAINTED(dir)) {
rb_raise(rb_eSecurityError, "Insecure: can't close");
}
GetDIR(dir, dirp);
rewinddir(dirp->dir);
return dir;
}