reopen file to same position as when file was closed