From: Paul Lutus Date: 2006-12-15T04:10:05+09:00 Subject: Re: Swap contents in two files Christopher Latif wrote: > I have two files, I want to swap the contents of the files in my > program, suggestions? > I arrived late, here's my untested solution: sa,sb, nevermind = ARGV da = File.read(sa) db = File.read(sb) File.open(sa,"w") { |f| f.write db } File.open(sb,"w") { |f| f.write da } Should work for all but the biggest files. -- Paul Lutus http://www.arachnoid.com