From: Michael Neumann Date: 2004-08-02T02:32:37+09:00 Subject: Re: Get the content of a file Dirk Einecke wrote: > Hi. > > Well - thanks to all. Now I've several ways: > > 1. > value = open(path) {|f| f.read} > > 2. > file = File.open(path, File::RDONLY) > value = file.read > file.close 2b. value = File.open(path) {|f| f.read} > 3. > value = File.readlines(path).to_s > > 4. > value = File.readlines(path).join > > What is the fastes way (for Ruby) and what should I use? 1. and 2. should be the fastest! Regards, Michael