End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Tempfile#size
size
lib/tempfile.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/tempfile.rb, line 234
def size
if !@tmpfile.closed?
@tmpfile.size # File#size calls rb_io_flush_raw()
else
File.size(@tmpfile.path)
end
end
Returns the size of the temporary file. As a side effect, the IO buffer is flushed before determining the size.