fix a bug: doesn't truncate when save file, if the new file's length is less than the origin file, then new will have a error format