[Top][All Lists]

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

Re: path separator

From: Keith MARSHALL
Subject: Re: path separator
Date: Wed, 24 Jan 2007 11:14:03 +0000

Brian Dessent wrote, quoting Bob Rossi:
>> For the simple minded like myself, does this boil down to the fact that
>> the PATH_SEPARATOR is different if an application is run from a cmd or
>> msys shell?
> The way I would have worded it would have been much simpler.
> If your app links against a POSIX emulation layer (cygwin1.dll or
> msys-1.0.dll) then use colon, otherwise use semicolon.  This is a static
> condition that does not change at all once the app is built, i.e. it
> does not depend on how it's executed.

Thanks for this clarification; as always, a different perspective helps
to focus the mind, and eliminate ambiguities.

> Assuming your app is a native app (i.e. the answer to the above is 'no')
> then even if your app is run from a MSYS sh.exe it should still get a
> copy of PATH that uses colons, ...

If you really meant what this says, then it's incorrect; any native app
run from an MSYS sh.exe will *see* a copy of PATH that uses *semicolons*,
but ...

> since MSYS sh.exe should be able to tell that this is not a MSYS binary.

... the MSYS sh.exe should *show* the PATH using colons, (and the user 
set it so within the shell); sh.exe will transform those colons to 
in the *copy* of PATH it gives to any app identified as native.

The bottom line is: any native app will *see* PATH_SEPARATOR == semicolon,
*regardless* of whether it is invoked from MSYS sh.exe, or from cmd.exe; 
MSYS sh.exe, you *set* PATH using *colon* as PATH_SEPARATOR; in cmd.exe, 
set PATH using *semicolon* as PATH_SEPARATOR.

> The "how it tells" is either by looking
> at whether it's linked against msys-1.0.dll or whether it's installed in
> the MSYS bin directory -- I forget which method is used and I think it
> changed recently anyway.

Installation in the MSYS /bin directory was a determinant, for versions
up to MSYS-1.0.10; MSYS-1.0.11 and later will not check this, requiring
only that the app be linked to msys-1.0.dll


reply via email to

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