public Method

Stat.rdev

stat.rdev     fixnum or nil

Returns an integer representing the device type on which stat resides. Returns nil if the operating system doesn’t support this feature.

File.stat("/dev/fd1").rdev   #=> 513
File.stat("/dev/tty").rdev   #=> 1280

Source Code

/*
*  call-seq:
*     stat.rdev   =>  fixnum or nil
*  
*  Returns an integer representing the device type on which
*  <i>stat</i> resides. Returns <code>nil</code> if the operating
*  system doesn't support this feature.
*     
*     File.stat("/dev/fd1").rdev   #=> 513
*     File.stat("/dev/tty").rdev   #=> 1280
*/

static VALUE
rb_stat_rdev(self)
   VALUE self;
{
#ifdef HAVE_ST_RDEV
   return ULONG2NUM(get_stat(self)->st_rdev);
#else
   return Qnil;
#endif
}
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.