From: Peter Vandenabeele Date: 2011-10-17T16:09:37+09:00 Subject: Re: I fixed this - but why does it work? --0016361e81d80aa45904af794a68 Content-Type: text/plain; charset=UTF-8 On Mon, Oct 17, 2011 at 1:52 AM, Edwin G. wrote: > I appreciate the help so far. I tried it in Windows under Cygwin and in > Ubuntu with similar results. I just ruby -v'd and got 1.8.7, OK, that explains. In ruby 1.8.7 it works as documented in the Pick Axe book (only class method on File, no instance method). Thanks for clearing that out :-) peterv@ASUS:~$ rvm use 1.8.7-p334 Using /home/peterv/.rvm/gems/ruby-1.8.7-p334 peterv@ASUS:~$ ruby -v ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-linux] peterv@ASUS:~$ irb 001:0> f1 = File.open('test','w') => # 002:0> f1.size NoMethodError: undefined method `size' for # from (irb):2 003:0> File.size("test") # as documented in Pick Axe => 0 004:0> File.size(f1) => 0 Peter --0016361e81d80aa45904af794a68--