Hi,
In message "[ruby-talk:5259] Re: problem: undefined method `size' for File"
on 00/10/03, DaVinci <bombadil / wanadoo.es> writes:
|> |print logfile.size("/home/eric/rubytest/fact.rb"), "\n"
|> >print File.size("/home/eric/rubytest/fact.rb"), "\n"
|>
|> And distinguish instance method and class method from now on.
|
| In this case I don't understand well why it should be a class method
| instead of instance method.
|
| Is there any reason or simply it is so?.
I don't know why you don't understand. ;-)
In this case, logfile is a instance of File class which represents a
connection to the certain file on the filesystem. So asking specific
instance for the filesize with pathname makes me feel weird.
Maybe
|> |print logfile.size, "\n"
makes sense. But unfortunately standard C does not provide the
portable way to get the size of opened file.
matz.