From: Dave Thomas Date: 2000-03-16T10:33:26-06:00 Subject: [ruby-talk:01898] Re: File operations "David Douthitt" writes: > What is the difference between File.open (open method of File class) > and internal function open? For regular files, there is none. However, the 'open' function also allows you to open pipes to subprocesses (by starting the name with a pipe character). > What is the difference between the IO methods each and each_line? They are synonyms. > 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. That's the big difference I can think of. Dave