Not an exact answer but maybe of use.
In searching the GitHub SWI-Prolog repositories for prolog_load_file/2 found one example.