public Method

Stat.file?

stat.file?     true or false

Returns true if stat is a regular file (not a device file, pipe, socket, etc.).

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

Source Code

/*
*  call-seq:
*     stat.file?    => true or false
*  
*  Returns <code>true</code> if <i>stat</i> is a regular file (not
*  a device file, pipe, socket, etc.).
*     
*     File.stat("testfile").file?   #=> true
*     
*/

static VALUE
rb_stat_f(obj)
   VALUE obj;
{
   if (S_ISREG(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.