I'm looking at file operations, and am getting confused - yet I may be running into "TMTOWTDI" :-)

"There's More Than One Way To Do It" :-)

What is the difference between File.open (open method of File class) and internal function open?

What is the difference between the IO methods each and each_line?  And how does

File.open(path).each_line { |line|
   ...
   }

differ from

File.open(path) { |f|
   f.readlines.each { |line|
      ....
      }
   }

???

I know at least that the first reads one line at a time from the file, and the second reads the file into an array and iterates over the array..... at least I think so.