Method: Dir.delete

Defined in:
dir.c

.delete(string) ⇒ 0 .rmdir(string) ⇒ 0 .unlink(string) ⇒ 0

Deletes the named directory. Raises a subclass of SystemCallError if the directory isn’t empty.

Overloads:

  • .delete(string) ⇒ 0

    Returns:

    • (0)
  • .rmdir(string) ⇒ 0

    Returns:

    • (0)
  • .unlink(string) ⇒ 0

    Returns:

    • (0)


1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
# File 'dir.c', line 1290

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);
}