I’m on version 10.0.2. I have an init.pl file:
:- multifile user:file_search_path/2.
user:file_search_path(home,Dir) :-
getenv(‘HOME’,Dir).
user:file_search_path(apps,home(‘Applications’)).
When I query for home and apps with file_search_path and absolute_file_name, the former works as expected but the latter doesn’t. Here’s what I got:
70 ?- file_search_path(home,X).
X = ‘/home/john’.
71 ?- file_search_path(apps,X).
X = home(‘Applications’).
72 ?- absolute_file_name(home,F).
F = ‘/home/john/home’.
73 ?- absolute_file_name(apps,F).
F = ‘/home/john/apps’.
Apparently, I don’t understand how absolute_file_name works. I don’t remember how to mark text in a post as code so I tried some other things. I wanted the absolute_file_name calls to give me ‘/home/john’ and ‘/home/john/Applications’. Where have I gone wrong?
Thanks