End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Dir.unlink
Dir.delete( string ) → 0
Dir.rmdir( string ) → 0
Dir.unlink( string ) → 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 = (int)(VALUE)rb_thread_call_without_gvl(nogvl_rmdir, (void *)p, RUBY_UBF_IO, 0);
if (r < 0)
rb_sys_fail_path(dir);
return INT2FIX(0);
}
Deletes the named directory. Raises a subclass of SystemCallError if the directory isn’t empty.