End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
File::Stat#rdev
stat.rdev → integer or nil
file.c
View on GitHub ↗
static VALUE
rb_stat_rdev(VALUE self)
{
#ifdef HAVE_STRUCT_STAT_ST_RDEV
# if SIZEOF_STRUCT_STAT_ST_RDEV <= SIZEOF_DEV_T
return DEVT2NUM(get_stat(self)->st_rdev);
# elif SIZEOF_STRUCT_STAT_ST_RDEV <= SIZEOF_LONG
return ULONG2NUM(get_stat(self)->st_rdev);
# else
return ULL2NUM(get_stat(self)->st_rdev);
# endif
#else
return Qnil;
#endif
}
Returns an integer representing the device type on which stat resides. Returns nil if the operating system doesn’t support this feature.
Example
File.stat("/dev/fd1").rdev #=> 513 File.stat("/dev/tty").rdev #=> 1280