Commit 95a141ee authored by Michael Hanus 's avatar Michael Hanus

setEnv/unsetEnv fixed

parent b869c1e7
Subproject commit 98291a3ddd1391a15267506b62d0c53984495c1e
Subproject commit 15e6b562f5f50feb39c0c18c2ea5c89267548d6c
......@@ -19,7 +19,7 @@
waitConcurrentConjunction/6,
appendAtom/3,
map1M/2, map2M/3, map1partialM/2, map2partialM/3,
getProgramArgs/1, getEnv/2,
getProgramArgs/1, getEnv/2, setEnv/2, unsetEnv/1,
noSingletonWarnings/0, noRedefineWarnings/0, noDiscontiguousWarnings/0,
getRunTime/1, getElapsedTime/1,
getCurrentMemorySize/1, getCurrentCodeSize/1,
......@@ -320,6 +320,12 @@ getProgramArgs(Args) :- prolog_flag(argv,Args,Args).
% get value of environment variable (fails if it is not set):
getEnv(Var,Val) :- environ(Var,Val), !.
% set an environment variable to some value:
setEnv(Var,Val) :- prolog:set_system_property(Var,Val), !.
% unset an environment variable:
unsetEnv(Var) :- setEnv(Var,''), !.
% no warnings for singleton variables:
noSingletonWarnings :- prolog_flag(single_var_warnings,_,off).
......
......@@ -16,7 +16,7 @@
append/3, member/2,
appendAtom/3,
map1M/2, map2M/3, map1partialM/2, map2partialM/3,
getProgramArgs/1, getEnv/2,
getProgramArgs/1, getEnv/2, setEnv/2, unsetEnv/1,
noSingletonWarnings/0, noRedefineWarnings/0, noDiscontiguousWarnings/0,
getRunTime/1, getElapsedTime/1,
getCurrentMemorySize/1, getCurrentCodeSize/1,
......@@ -237,6 +237,12 @@ dropSWIPL(Args,Args).
% get value of environment variable (fails if it is not set):
getEnv(Var,Val) :- getenv(Var,Val), !.
% set an environment variable to some value:
setEnv(Var,Val) :- setenv(Var,Val), !.
% unset an environment variable:
unsetEnv(Var) :- unsetenv(Var), !.
% no warnings for singleton variables:
noSingletonWarnings :- style_check(-singleton).
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment