| Did you know ... | Search Documentation: |
| file->find |
When file<-name
does not start with a’.’or’/’, file->find
will loop through the directories of the path, append the file<-name
of the file and check whether the resulting file has file->access.
When successful, it will set
file->name
to the full pathname of the file.
This method is used by image->load
and bitmap->load
to locate bitmap files.
The example below is a PCE/Prolog implementation of the Unix utility which for locating executable files.
which(Name, File) :-
get(@pce, environment_variable, 'PATH', Path),
new(F, file(Name)),
send(F, find, Path, execute),
get(F, absolute_path, File).
Defaults: The default access is read. The default
path is’.’
Diagnostics: Fails silently if the file cannot be found in the provided path.