I think it will be better to add the kpse_record_input() when the file is actually opened (not tested): Indeed. I applied it, thanks.