From: Robert Klemme Date: 2009-02-08T01:34:14+09:00 Subject: Re: File#size On 07.02.2009 16:34, Roger Pack wrote: > Dylan Evans wrote: >> How about file.stat.size ? > > ooh that's really close. > I might want one that takes into account unflushed buffers, though. > Apparently .stat.size doesn't quite. > >>> a.write 'abc' > => 3 >>> a.stat.size > => 0 >>> a.flush > => # >>> a.stat.size > => 3 > > But at least it's pretty close. > -=r So you want to know how much you have written? Then use #tell http://www.ruby-doc.org/core/classes/IO.html#M002304 robert