static public Method

Dir.delete(p1)

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

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

Source Code

/*
*  call-seq:
*     Dir.delete( string ) => 0
*     Dir.rmdir( string ) => 0
*     Dir.unlink( string ) => 0
*
*  Deletes the named directory. Raises a subclass of
*  <code>SystemCallError</code> if the directory isn't empty.
*/
static VALUE
dir_s_rmdir(obj, dir)
   VALUE obj, dir;
{
   check_dirname(&dir);
   if (rmdir(RSTRING(dir)->ptr) < 0)
       rb_sys_fail(RSTRING(dir)->ptr);

   return INT2FIX(0);
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.