truncating file to the last completed record o failure