[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get the preferred environment variable path separator?

From: tomas
Subject: Re: How to get the preferred environment variable path separator?
Date: Tue, 29 Mar 2016 09:53:16 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Hash: SHA1

On Mon, Mar 28, 2016 at 06:36:33PM +0300, Eli Zaretskii wrote:
> > Date: Mon, 28 Mar 2016 10:24:56 -0400
> > From: "Thompson, David" <address@hidden>
> > Cc: Guile User <address@hidden>, Chris Marusich <address@hidden>
> > 
> > The environment variable path separator is *not* defined depending on
> > the OS.  It is up to the programs that interpret these search paths to
> > specify what the separator should be [...]

> We are not talking about the OS, we are talking about the programs
> that set and query environment variables using 'getenv', 'putenv', and
> other similar APIs, followed by simple string processing.  And those
> are definitely _not_ treating the separator as opaque, something you
> can easily verify both by looking at the sources of the respective
> applications, and by simple experiments.
> And in that sense, the path separator character is always ':' on Posix
> systems and ';' on MS-Windows.  So I think Guile ought to have such a
> variable; Emacs, for one, does.

Indeed, this is one of those "it's up to the applications, but things
get weird if you use the 'wrong' one"[1]. Originally it's just a shell
thing, but as Paul noticed upthread, the convention has crept to other
places (execvp and execlp) which are beyond the shells (strictly
speaking it's "just" the libc, and in accordance to POSIX, and for
us oldtimers not "the OS", but hey).

I've had a peek into Perl's and Tcl's sources, and both set that as
a config-time attribute (Perl has one giant hash of config-time things,
and there it's $Config{path_sep}, for example)

So yes, probably Guile should have something like that.

- - - - -
[1] Or perhaps "you can use any character as separator as long as
it is ':'"

- -- tomás
Version: GnuPG v1.4.12 (GNU/Linux)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]