Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

File::Stat#readable?

() -> bool
stat.readable? → true or false

Returns true if stat is readable by the effective user id of this process.

Example
File.stat("testfile").readable?   #=> true
See also #rdev_minor #readable_real? #rdev_major #setgid? also in 4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0