X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:subject:to:references:from:message-id:date
	:mime-version:in-reply-to:content-type
	:content-transfer-encoding; q=dns; s=default; b=v96pCnO5OzwXs3w3
	nY6nbHl9ZMW/axiuItADl1wJprawbOC2aB6B2hQehZJ1SpjVDCKNtJCu3GieVK3+
	N8P7EANW+U3Whm/0HochwxmY0jONO39HU/4oqV6Y31XNGOCYBAWl6BId4TqwAg7E
	WArf+j8SrrzC8mfhq7hy7SmggX0=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:subject:to:references:from:message-id:date
	:mime-version:in-reply-to:content-type
	:content-transfer-encoding; s=default; bh=yRlGP5UHfBvBGnBRPQbGUX
	0oBIw=; b=doK1Lr1OlwnPCBb8ZWPdeDyDGeI7B7NbpCg7ra4Mmc3Lt+LoyOZJVU
	7YI1sehw4XKEcYVSBhycaZ30wq5T5KyYXUqZ695Z5tTiutpfQcA49GxLSL3rOZpj
	Wbo+zdZPxiHQNwQxog1JzKTcmqqv7ou00KH/hCdI40AQk8tWSETYk=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=artificial, TXT, ESC, esc
X-HELO: mail-it0-f44.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=1e100.net; s=20130820;        h=x-gm-message-state:subject:to:references:from:message-id:date         :user-agent:mime-version:in-reply-to:content-transfer-encoding;        bh=8VawqSEmozFQ7aN2VHMSd4qyI36yjFgY1KyzUaT0Pxc=;        b=kBtmqC9MAKn7imkBEnHyyrEcuGJrkYn6LI1PiXlpZO20DlF5NAtOcQ9Rxa0TbG8VwE         i0IndCIX0wQIASSdvf90PBamfeGFrbMLAcETGqrvEtaiBkkEZ7+3qq4HWHl04piLwOBh         a4/8qPVKxP5HKmMnM1XdeuMRJgUjrbqFBmkGUtw7Rk//r/xfv8CI/J1yposWEq/t7FA2         gjYYg8m+N7OmhsfBTKgo2cS+oTqsd/C1iIeD9GjiosqRtc5hXVsrgaWVQ8s5I+3/VIFN         a87WGui5CkLjappHKKv56OBIDk/mwc6qqUmxrvID9+TDQnZdiki87wfrT/cfGJHHsLCu         6yvQ==
X-Gm-Message-State: AEkoouvfZ/3NmBHVl84nVMWnhw90hwslTFCX0OPNiA/JqnPQG9TpyRCyIbTxhykQf6IpYg==
X-Received: by 10.36.70.193 with SMTP id j184mr17644788itb.39.1470663825533;        Mon, 08 Aug 2016 06:43:45 -0700 (PDT)
Subject: Re: PATHEXT is fundamental to Windows and Should be recognised by CYGWIN
To: cygwin@cygwin.com
References: <001001d1edf1$a4e1ae90$eea50bb0$@rogers.com> <1C0AE95E-0118-4353-AA77-4D41F1AE9AE1@solidrocksystems.com> <001a01d1eea9$f7949a90$e6bdcfb0$@rogers.com> <76ec05e9-140a-19cb-942b-698582c3d024@gmail.com> <001f01d1ef2c$f04af9e0$d0e0eda0$@rogers.com> <20160805152951.GO25811@calimero.vinschen.de> <57A6ED1C.1060402@gmx.de> <20160808112321.GF32150@calimero.vinschen.de>
From: cyg Simple <cygsimple@gmail.com>
Message-ID: <e90174df-61b4-17c8-064b-30009e6ad559@gmail.com>
Date: Mon, 8 Aug 2016 09:43:54 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0
MIME-Version: 1.0
In-Reply-To: <20160808112321.GF32150@calimero.vinschen.de>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-IsSubscribed: yes

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
executes.

As for PATHEXT we can do the following scenario instead.

export PATHEXT="$PATHEXT;.TXT"
vi foo.txt
:set ff=dos
i
a
b
c
<ESC>
:wq
cmd /c foo

-- 
cyg Simple

--
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

