public Method

Stat.chardev?

stat.chardev?     true or false

Returns true if the file is a character device, false if it isn’t or if the operating system doesn’t support this feature.

File.stat("/dev/tty").chardev?   #=> true

Source Code

/*
*  call-seq:
*     stat.chardev?    => true or false
*  
*  Returns <code>true</code> if the file is a character device,
*  <code>false</code> if it isn't or if the operating system doesn't
*  support this feature.
*     
*     File.stat("/dev/tty").chardev?   #=> true
*     
*/

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