From: William James Date: 2007-09-22T15:55:03+09:00 Subject: Re: I am new to Ruby and I could use some expert advice as to how I can make this code run faster. On Sep 20, 5:02 pm, Ruby Maniac wrote: > File.exist?(_fname) if File.delete(_fname) This is equivalent to if File.delete(_fname) File.exist?(_fname) end That's not what you want. Furthermore, there's no need to delete the file. If you open it in mode "wb", the existing contents will be obliterated.