Did you know ... Search Documentation:
Pack xlibrary -- prolog/call_in_dir.pl
PublicShow source
 call_in_module_dir(+Module, :Goal) is nondet
Call Goal with the process working directory temporarily changed to the directory that contains the source file of Module. The original working directory is restored after Goal succeeds, fails, or throws.

Fails if Module has no associated source file.

 call_in_load_dir(:Goal) is nondet
Call Goal with the process working directory temporarily changed to the directory from the current load context. This is useful for directives that need paths relative to the file being loaded. The original working directory is restored after Goal succeeds, fails, or throws.
 call_in_dir(+Dir, :Goal) is nondet
Call Goal with the process working directory temporarily changed to Dir. The previous working directory is restored using setup_call_cleanup/3, regardless of whether Goal succeeds, fails, or throws.