Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Tempfile#size
() -> ::Integer
size
lib/tempfile.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/tempfile.rb, line 347
def size
if !__getobj__.closed?
__getobj__.size # File#size calls rb_io_flush_raw()
else
File.size(__getobj__.path)
end
end
Returns the size of the temporary file. As a side effect, the IO buffer is flushed before determining the size.