From: THAKUR PRASHANT SINGH Date: 2010-02-27T16:04:04+09:00 Subject: Re: Class Function call vs Normal Function call I will do the changes proposed. It indeed looks a good solution Thanks, Prashant -----Original Message----- From: b.candler@pobox.com [mailto:b.candler@pobox.com] Sent: Saturday, February 27, 2010 2:09 AM To: ruby-talk ML Subject: Re: Class Function call vs Normal Function call THAKUR PRASHANT SINGH wrote: > Thanks for help I think I got the issue solved. > file = File.open("kml/#{@file_names[file_index]}","w") > file.write(@kml_file_data.to_xml) > file.close > The last line was missing. When I closed the file the problem > disappeared And this problematic code wasn't in the source you posted :-) For a cleaner solution, you could use the same block form that you were using for the zip files: File.open("kml/#{@file_names[file_index]}","w") do |file| file.write(@kml_file_data.to_xml) end This is better because the file will *always* be closed, even if an exception is raised in the block. -- Posted via http://www.ruby-forum.com/.