delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/10/01/23:07:23

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
From: Chris Faylor <cgf AT cygnus DOT com>
Date: Sun, 1 Oct 2000 23:05:37 -0400
To: "Cygx (E-mail)" <cygwin-xfree AT sources DOT redhat DOT com>,
"'cygwin AT sources DOT redhat DOT com'" <cygwin AT sources DOT redhat DOT com>
Cc: Harold AT compasstechnologies DOT com
Subject: Re: bash [ -f filename ] behavior
Message-ID: <20001001230537.A12588@cygnus.com>
Reply-To: cygwin AT sources DOT redhat DOT com
Mail-Followup-To: "Cygx (E-mail)" <cygwin-xfree AT sources DOT redhat DOT com>,
"'cygwin AT sources DOT redhat DOT com'" <cygwin AT sources DOT redhat DOT com>,
Harold AT compasstechnologies DOT com
References: <896908DA55C4D311B9C000C04F01A05410A6E2 AT ENTERPRISE>
Mime-Version: 1.0
User-Agent: Mutt/1.3.6i
In-Reply-To: <896908DA55C4D311B9C000C04F01A05410A6E2@ENTERPRISE>; from Harold@compasstechnologies.com on Sun, Oct 01, 2000 at 10:54:28PM -0400

On Sun, Oct 01, 2000 at 10:54:28PM -0400, Harold Hunt wrote:
>Make a bash script file containing the following line:
>if [ -f imake ]; then mv imake imake.foo; fi
>
>Follow these steps under Cygwin's Bash:
>
>Run the script in a directory with no files named imake or imake.exe.  The
>script will detect that imake does not exist, so it will not attempt to move
>the file.

FYI, the shell that make will use, by default, in a normal Cygwin
installation is 'ash' (aka /bin/sh), not 'bash'.

>Run 'touch imake', then run the script again.  The script will move file
>imake to imake.foo, as it should.
>
>Run 'touch imake.exe', then run the script again.  The script will think
>that a file named 'imake' exists, even though it doesn't; the script will
>then attempt to move file 'imake', which does not exist, and the script will
>fail.

Cygwin's stat() function has historically always found a 'foo.exe' when
passed a 'foo' argument.

>Now, run the same steps under Linux's Bash, and you'll notice that the
>script does not get confused when a file named 'imake.exe' exists.

I'm sure that you can find many many many similar observations of this
sort on the cygwin mailing list over the years if you want to search
the archives.

>This bug, or feature (as it may help compatibility), currently causes
>XFree86 to fail when building under Cygwin.  I'm going to send in a
>patch to XFree86 to check for 'imake.exe' before checking for 'imake';
>that will fix the build bustage for now.  But, I figure the Cygwin guys
>might want to evaluate whether this is really desired behavior...

It's long standing behavior.  I have no idea what would break if we
changed it now.

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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