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]=20
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 =3D 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=20
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=20
exception is raised in the block.
--=20
Posted via http://www.ruby-forum.com/.