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/.