Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

File::Stat#dev_major

() -> ::Integer?
dev_major → integer

Returns nil on Windows.

On other systems, returns the major part of the device number for the snapshot in self:

Example
File.stat('/etc').dev_major # => 259
File.stat('/dev').dev_major # => 0
See also #dev #dev_minor #ctime #directory? also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0