public Method

Stat.directory?

stat.directory?    true or false

Returns true if stat is a directory, false otherwise.

File.stat("testfile").directory?   #=> false
File.stat(".").directory?          #=> true

Source Code

/*
*  call-seq:
*     stat.directory?   => true or false
*  
*  Returns <code>true</code> if <i>stat</i> is a directory,
*  <code>false</code> otherwise.
*     
*     File.stat("testfile").directory?   #=> false
*     File.stat(".").directory?          #=> true
*/

static VALUE
rb_stat_d(obj)
   VALUE obj;
{
   if (S_ISDIR(get_stat(obj)->st_mode)) return Qtrue;
   return Qfalse;
}
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.