delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/08/09/18:24:39

X-Recipient: archive-cygwin AT delorie DOT 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:content-type:mime-version:subject:from
:in-reply-to:date:content-transfer-encoding:message-id
:references:to; q=dns; s=default; b=Y2iDR4cXBcGtUmqvHrKdCsnPjwuT
mqAC+yWddn/4ac+H7tSBPF1w+IH53v52w9xuSG/4a/oaNtm4AeFDWyjYDSiMwVbC
zRa+4Rqp4VIzAiu4kNPK9m6conG3gr+XWDakJjfxLcaJ434yZJSGTK04RuOGAEcM
MKvZTExAEfxB9qk=
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:content-type:mime-version:subject:from
:in-reply-to:date:content-transfer-encoding:message-id
:references:to; s=default; bh=EcZ6oPXvDOUyFEJvbMOASaCo6Fc=; b=jW
UvtDHAI8NHuwXwwn2JdOQ134MYXwpLLm1ELATbjP2bhT9fb9GQlbMlQqNsjVoxNb
DUw5J56zPWWMOdYu0Qu70B3/XrX3AAWiwRe4d5KpvHkjQ2GyWtIJWKZsvnhY+Niq
gHyk70vy1bAWfDLBvFp/xoAqjat4WzsLda0SHrtaA=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=AWL,BAYES_40,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=eriksoderquist AT gmail DOT com, eriksoderquistgmailcom, ErikSoderquistgmailcom, ErikSoderquist AT gmail DOT com
X-HELO: etr-usa.com
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
Subject: Re: PATHEXT is fundamental to Windows and Should be recognised by CYGWIN
From: Warren Young <wyml AT etr-usa DOT com>
In-Reply-To: <CACoZoo3RWuH0q3anVA5VADo6oQjSQDu2BLOfzFK7yCb8FTgbgA@mail.gmail.com>
Date: Tue, 9 Aug 2016 16:24:21 -0600
Message-Id: <25EDBA91-4612-44E5-81E2-4AA6D5565BFA@etr-usa.com>
References: <001001d1edf1$a4e1ae90$eea50bb0$@rogers.com> <1C0AE95E-0118-4353-AA77-4D41F1AE9AE1 AT solidrocksystems DOT com> <001a01d1eea9$f7949a90$e6bdcfb0$@rogers.com> <76ec05e9-140a-19cb-942b-698582c3d024 AT gmail DOT com> <001f01d1ef2c$f04af9e0$d0e0eda0$@rogers.com> <20160805152951 DOT GO25811 AT calimero DOT vinschen DOT de> <57A6ED1C DOT 1060402 AT gmx DOT de> <CACoZoo1Qc59ybMzmaWpqMYgyzgjA4vdA=pv0567V8=EGf-Gu3g AT mail DOT gmail DOT com> <CACoZoo3RWuH0q3anVA5VADo6oQjSQDu2BLOfzFK7yCb8FTgbgA AT mail DOT gmail DOT com>
To: The Cygwin Mailing List <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u79MOa2F018048

On Aug 8, 2016, at 8:00 AM, Erik Soderquist <ErikSoderquist AT gmail DOT com> wrote:
> 
> On Mon, Aug 8, 2016 at 9:52 AM, Erik Soderquist wrote:
>> On Sun, Aug 7, 2016 at 4:11 AM, Herbert Stocker wrote:
>>>> 
>>>> 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.
>> 
>> Were you testing for the existence of a *directory* (
>> /dir/subdir/something/. ) or for anything named *something* in
>> /dir/subdir/ ?

[snip]

> $ touch /tmp/foo.exe
> 
> $ if [ -e /tmp/foo ] ; then echo yes ; else echo no ; fi
> yes

Yes, but:

   $ if [ -d /tmp/foo ] ; then echo yes ; else echo no ; fi
   no

The existence check is because foo == foo.exe == foo.lnk under Cygwin, but the original complaint came from someone checking for a directory.  So, the lesson is, fix the stat(2)/test(1) call, don’t change Cygwin to cope with a bad test.
--
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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019