Boost logo

Boost Users :

From: Stuart Dootson (stuart.dootson_at_[hidden])
Date: 2006-01-20 14:12:35


On 1/20/06, Sebastian Redl <sebastian.redl_at_[hidden]> wrote:
> Angus Leeming wrote:
>
> >Sebastian Redl wrote:
> >
> >
> >>Another interesting addition would be replacing of referenced
> >>environment variables within the variable - does getenv() do
> >>that?
> >>
> >>
> >
> >Sorry, I don't follow.
> >
> >Angus
> >
> >
> Especially in Windows, many environment variables contain a sequence
> %something%, which tells the shell to substitute this sequence with the
> environment variable something. An example is the PATH variable, which
> contains, I believe, %WINDIR% as an early entry. I wonder whether the
> Win32 implementation of getenv() does this, or if it should be done by
> an external function.
>
> Sebastian Redl

Well, ExpandEnvironmentStrings
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/expandenvironmentstrings.asp)
does what you want.

A cursory look at the man pages on my iBook doesn't reveal anything
obviously similar for OS X (and, I suspect, other Unix based operating
systems).

In addition, a Boost implementation would likely have to cater for the
two flavours of embedded environment string, i.e. "%WINDIR%\some_file"
as used in Windows and "$HOME/.bashrc" in Unix. And then, do you want
to support the various expansion operations the two OSs give you. And
what about other OSs like VMS...

Anyway - there's a solution under Windows...

Stuart Dootson


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net