Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Tempfile#length
length
lib/tempfile.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/tempfile.rb, line 274
def size
if !__getobj__.closed?
__getobj__.size # File#size calls rb_io_flush_raw()
else
File.size(__getobj__.path)
end
end
Alias of #size
Returns the size of the temporary file. As a side effect, the IO buffer is flushed before determining the size.