File should be closed when iteration finished or external merge sort finished, I can't find close() function or maybe I miss some hidden corners.