class method
Dir.delete
(::path dirname) -> 0
Dir.rmdir(dirpath) → 0
dir.c
View on GitHub ↗
static VALUE
dir_s_rmdir(VALUE obj, VALUE dir)
{
const char *p;
int r;
dir = check_dirname(dir);
p = RSTRING_PTR(dir);
r = IO_WITHOUT_GVL_INT(nogvl_rmdir, (void *)p);
if (r < 0)
rb_sys_fail_path(dir);
return INT2FIX(0);
}
Removes the directory at dirpath from the underlying file system:
Example
Dir.rmdir('foo') # => 0
Raises an exception if the directory is not empty.