Write file out.