Re-write file