This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: execlp/execvp needs case-correct PATH
- From: Thomas Wolff <towo at towo dot net>
- To: cygwin at cygwin dot com
- Date: Tue, 10 Feb 2015 20:14:24 +0100
- Subject: Re: execlp/execvp needs case-correct PATH
- Authentication-results: sourceware.org; auth=none
- References: <54D7EB8E dot 8070308 at towo dot net> <20150209101747 dot GA12131 at calimero dot vinschen dot de> <54D91D54 dot 5000705 at towo dot net> <20150210092756 dot GC15989 at calimero dot vinschen dot de>
Am 10.02.2015 um 10:27 schrieb Corinna Vinschen:
On Feb 9 21:49, Thomas Wolff wrote:
Am 09.02.2015 um 11:17 schrieb Corinna Vinschen:
On Feb 9 00:04, Thomas Wolff wrote:
With a Windows case sensitive file system (and according mount flags
for /cygdrive), the PATH does not properly reflect casing of the actual
directories (e.g. C:\WINDOWS vs. C:\Windows, thanks MS...).
However, the shell finds programs anyway, like e.g. notepad.
The exec*p system calls, on the other hand, do not find a program in this
case as demonstrated by the attached test program.
This is in contrast to the Linux (and POSIX?) manual page which claims
âThe execlp(), execvp(), and execvpe() functions duplicate the actions
of the shell in searching for an executable file ââ
...
Sorry, I forgot one detail: I added /cygdrive/c/Windows/System32 to my path
so the shell will find it, but yet execlp does not find it.
Which makes sense, given that notepad is not in C:\Windows\System32, but in C:\Windows.
On my systems (Windows 7 Professional/Ultimate) itâs in both C:\Windows
and C:\Windows\System32
(otherwise the shell wouldnât have found it after adding to the path).
However, I could resolve the issue partly by putting
/cygdrive/c/Windows (or ../System32) in the path *before* the bogus
/cygdrive/c/WINDOWS - weird, but this way exec*p works.
With the old setting (bogus first in path), apparently/assumedly exec*p
somehow finds the file in /cygdrive/c/WINDOWS but then cannot start it
from there because of the case mis-match.
Thereâs still the inconsistency with shell behaviour.
------
Thomas
---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprÃft.
http://www.avast.com
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple