From: hipster Date: 2000-10-03T18:18:42+09:00 Subject: [ruby-talk:5256] Re: problem: undefined method `size' for File On Tue, 03 Oct 2000 18:10:05 +0900, 葡ic Santonacci wrote: > logfile = File.open("/home/eric/rubytest/fact.rb", "r") > > print logfile.size("/home/eric/rubytest/fact.rb"), "\n" > > I have all the rights for the dedicated file. > I tryed new and open method with various mode and size method > with or without parameters. If I replace the method 'size' with 'atime', > it works well. I had a look in mailing list and news group archives > but couldn't find any answers to my question. I'm using manual > for 1.4, is it still valid? size is a class method of File, so you cannot apply it to an instance (variable 'logfile') of File. Use File.size("...") As you will notice in the reference (http://www.rubycentral.com/ref) 'atime' is both a class and an instance method of File, so you had a bit of bad luck picking your test. bye Michel