add and commit index and resume file.