Dear All,
In Java I find these two system properties
which are usually populated:
user.home: User home directory
os.name: Operating system name
System Properties (The Java™ Tutorials > Essential Java Classes > The Platform Environment)
Is there something similar commonly used
in Prolog systems. In SWI-Prolog I only find:
?- current_prolog_flag(home, X).
X = 'd:/software/logic/swipl'.
?- current_prolog_flag(arch, X).
X = 'x64-win64'.
Which is not exactly the information I am looking
for. I am currently planning to introduce
a new flag:
user_dir: Result of mingling user.home,
relative to os.name.
if (osname != null && osname.startsWith("Windows XP")) {
file = new File(userhome, "Application Data");
} else if (osname != null && osname.startsWith("Windows")) {
file = new File(new File(userhome, "AppData"), "Roaming");
} else if (osname != null && osname.startsWith("Mac OS X")) {
file = new File(new File(userhome, "Library"), "Preferences");
} else {
file = new File(userhome);
}
This directory can be used for user settings
and preferences etc… Something similar available
in SWI-Prolog?
Best Regards