core: with_temp_file in env