Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getenv/2 doesn't enumerate all environment variables #2572

Open
hurufu opened this issue Sep 25, 2024 · 0 comments
Open

getenv/2 doesn't enumerate all environment variables #2572

hurufu opened this issue Sep 25, 2024 · 0 comments

Comments

@hurufu
Copy link
Contributor

hurufu commented Sep 25, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant