1:- module(os_windows, []).

Microsoft Windows Operating System

By design, the following extensions for Windows avoid underscores in order not to clash with existing standard paths, e.g. app_path which Prolog defines by default.

userprofile
onedrive
onedrivecommercial
onedrivepersonal
programfiles
temp
documents
savedgames
appdata
applocal
localprograms

/

   23:- multifile user:file_search_path/2.   24
   25name_path(Name, Path) :-
   26    current_prolog_flag(windows, true),
   27    getenv(Name, Path),
   28    exists_directory(Path).
   29
   30user:file_search_path(userprofile, Path) :- name_path(userprofile, Path).
   31user:file_search_path(onedrive, Path) :- name_path(onedrive, Path).
   32user:file_search_path(onedrivecommercial, Path) :-
   33    name_path(onedrivecommercial, Path).
   34user:file_search_path(onedrivepersonal, Path) :-
   35    name_path(onedrivepersonal, Path).
   36user:file_search_path(programfiles, Path) :- name_path(programfiles, Path).
   37user:file_search_path(temp, Path) :- name_path(temp, Path).
   38
   39user:file_search_path(documents, userprofile('Documents')).
   40user:file_search_path(savedgames, userprofile('Saved Games')).
   41user:file_search_path(appdata, userprofile('AppData')).
   42user:file_search_path(applocal, appdata('Local')).
   43user:file_search_path(localprograms, applocal('Programs'))