Tab: ensure file is closed after reading