From: Patrick Doyle Date: 2008-09-13T00:09:40+09:00 Subject: Re: strange behaviors in writing/saving file On Fri, Sep 12, 2008 at 9:10 AM, Li Chen wrote: > Hi Patrick, > > Thanks for the input. > > Now the problem is sovled by changing the mode 'w' to 'a' as following: > > File.open('test.txt','a'){|f| puts e.inner_text; f.puts e.inner_text} > Just be aware that text will be appended to the file forever. You might want to do something at the top of your script to remove or empty the file, if you don't want to be confused by past results. --wpd