Changing Solaris environment variables so os:getenv/1 gets the ne w

Patrik Nyblom <>
Wed Mar 29 11:41:28 CEST 2000


Hi,

Sean Hinde wrote:

> Thanks Peter:
>
> > Try os:putenv(Var, Value).
> >
> > /Peter
>
> An intriuging answer. There is no documentation on this, it is not in module
> os source, and m(os). returns:
>
> Exports:
>          cmd/1
>          find_executable/1
>          find_executable/2
>          handle_call/3
>          handle_info/2
>          init/1
>          module_info/0
>          module_info/1
>          start_link/0
>          terminate/2
>          type/0
>          version/0
>
> I guess it is a BIF. I must look through the source sometime and see what
> other goodies are in there.

It is "technically" a BIF. Unfortunately such creatures does not show up when
doing a Module:module_info() (or an m(Module)). They *should* be documented
though. This may be a deliberate "documentation bug", as the result of
os:putenv/2 does *not* always show up when using os:cmd/1 (due to the fact that
the shell is "kept" between commands). Both the os:cmd problem and the missing
documentation should, and will, be fixed.

Until recently, there were a lot of undocumented BIF's in the system. We now
try to have all BIF's documented and instead warn in the documentation if the
BIF is likely to change in the future or is strange in some other way. We seem
to have overlooked this one.

/Patrik

>
>
> Cheers,
> Sean




More information about the erlang-questions mailing list