Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
File#size
file.size → integer
file.c
View on GitHub ↗
static VALUE
file_size(VALUE self)
{
return OFFT2NUM(rb_file_size(self));
}
Returns the size of file in bytes.
Example
File.new("testfile").size #=> 66