Repair endoffile for temp files