From: matz@... (Yukihiro Matsumoto) Date: 2000-10-04T09:51:47+09:00 Subject: [ruby-talk:5269] Re: problem: undefined method `size' for Fil e Hi, In message "[ruby-talk:5264] Re: problem: undefined method `size' for Fil e" on 00/10/04, Aleksi Niemel� writes: |matz critizes good solution argumenting with features lacking from some |widely available programming language: which implements Ruby interpreter. ;-) |Humm..how about: | | class File | def size | FileTest.size(self.path) | end | end | | p File.new("file_size.rb").size As Guy pointed out, things is not that simple. Probably class File def size self.flush self.stat.size end end is better. But I'm not sure whether this works for all cases. matz.