This is the mail archive of the
mailing list for the Cygwin project.
Re: PATHEXT is fundamental to Windows and Should be recognised by CYGWIN
On 8/8/2016 7:23 AM, Corinna Vinschen wrote:
> On Aug 7 10:11, Herbert Stocker wrote:
>> On 05.08.2016 17:29, Corinna Vinschen wrote:
>> If you see the
>>> code required to handle .exe and .lnk extensions you don't *want*
>>> PATHEXT support anymore.
>> Moreso, this code has recently broken my C++ code in Cygwin.
>> It tried to see if a directory /dir/subdir/something existed,
>> and Cygwin said yes because it found a /dir/subdir/something.exe .
>> So my program failed.
> I have some doubt here. Cygwin always checks for "foo" first.
> Only if it doesn't find "foo", it checks for "foo.exe", then
> for "foo.lnk" and last, for backward compat, for "foo.exe.lnk".
Which is the exact cause of the issue.
> In the POSIX realm, "foo" == "foo.exe" == "foo.lnk". The search itself
> is indiscriminately, because Cygwin can't know if you're looking for
> "foo" or "foo.exe" or a symlink "foo" using the .lnk suffix.
Why do you say "In the POSIX realm"? Only Cygwin does this association.
I understand why it does so but is there a different way to achieve the
same thing with greater accuracy? Maybe we don't want the artificial
symlink of foo == foo.exe all the time. Maybe it is time we drop the
artificial symlink altogether in preference for modifying the scripts
and programs to use .exe when on Windows including Cygwin or perhaps
creating a real symlink for foo.exe to foo. Dropping the artificial
symlink would simplify the code and increase the speed with which it
As for PATHEXT we can do the following scenario instead.
cmd /c foo
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple