replace File::write to make ruby 1.9.2 happy