From: 7stud -- Date: 2007-10-15T10:42:08+09:00 Subject: Re: Nested blocks? Randy Kramer wrote: > > Is it worth doing? > > g = File.open("test.aml", "w") > File.open("test.txt", "r").each { |line| g.puts line} > g.close > > Aside: I suppose it's obvious, but basically the program copies test.txt > to > test.aml one line at a time. Here are some other possibilities that might work for you depending on what you're actually trying to accomplish: 1) File.rename('test.txt', 'test.aml') 2) require 'fileutils' FileUtils.copy('test.txt', 'test.aml') -- Posted via http://www.ruby-forum.com/.