From: Sam Roberts Date: 2004-01-26T08:21:11+09:00 Subject: Re: Regurgitating the contents of a file If you don't want the whole file in-memory, maybe look at copy_stream from file_utils: http://www.ruby-doc.org/docs/rdoc/1.9/classes/FileUtils.html#M001407 Cheers, Sam Quoteing dcarrera@math.umd.edu, on Mon, Jan 26, 2004 at 08:16:01AM +0900: > On Mon, Jan 26, 2004 at 08:07:46AM +0900, Philip Mak wrote: > > What's the shortest way to regurgitate the contents of a file? I mean > > like this: > > > > # Perl code > > open(FILE, "filename.txt"); > > print while ; > > close(FILE); > > > > Can I do something like: > > > > stdout << File.new("filename.txt"); > > > > or something? > > puts File.open("filename.txt").to_a > > > Cheers, > -- > Daniel Carrera | No trees were harmed in the generation of this e-mail. > PhD student. | A significant number of electrons were, however, severely > Math Dept. UMD | inconvenienced. > >