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: List-Subscribe: List-Archive: List-Post: List-Help: , 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 Content-Type: text/plain; charset=utf-8 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 In-Reply-To: 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> To: The Cygwin Mailing List X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u79MOa2F018048 On Aug 8, 2016, at 8:00 AM, Erik Soderquist 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