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#zero?
stat.zero? → true or false
file.c
View on GitHub ↗
static VALUE
rb_stat_z(VALUE obj)
{
if (get_stat(obj)->st_size == 0) return Qtrue;
return Qfalse;
}
Returns true if stat is a zero-length file; false otherwise.
Example
File.stat("testfile").zero? #=> false