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)

1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
# File 'dir.c', line 1265

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