scryer-prolog icon indicating copy to clipboard operation
scryer-prolog copied to clipboard

getenv/2 doesn't enumerate all environment variables

Open hurufu opened this issue 5 months ago • 0 comments

As in the title, getenv/2 doesn't enumerate all environment variables:

?- use_module(library(os)).
   true.
?- getenv(K, V).
   error(instantiation_error,must_be/2).

This reduces usefulness of said predicate. The possible workaround is to use system's printenv (1) program and parse it's output, but it is ugly and platform-dependent.

hurufu avatar Sep 25 '24 09:09 hurufu