Method: File::Stat#rdev

Defined in:
file.c

#rdevInteger?

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

Returns:



769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
# File 'file.c', line 769

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
}