From: Dave Thomas Date: 2000-12-17T11:29:35+09:00 Subject: [ruby-talk:7493] Re: finding the file size Mathieu Bouchard writes: > > > If aFile = File.open("myfile.txt") then why is the syntax for finding out > > > the file size > > > File.size(aFile) instead of aFile.size? > > The class method is there because you don't have to open a file to > > determine it's size. In fact, you can find the size of files which you > > don't have permission to open. > > You mean File.stat(name).size right? File.size(name) is pretty much > useless except for inciting users to ask for File#size. I must be missing something: File.size("/etc/passwd") # => 2271 Dave