Skip to content

End of Life Ruby 3.1 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

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
See also #pipe? #rdev_major #owned? #rdev_minor also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0