use File.open( .., 'w') instead of File.write so it works in --1.8 mode