Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
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
Message-ID: <430B0B09.4080602@byu.net>
Date: Tue, 23 Aug 2005 05:39:53 -0600
From: Eric Blake <ebb9@byu.net>
Reply-To: cygwin@cygwin.com
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
MIME-Version: 1.0
To: Chris Mumford <cmumford@Credant.com>
CC: bug-coreutils@gnu.org, cygwin@cygwin.com
Subject: Re: Bug in cygwin's mkdir
References: <6EBAD6646B5F934E8E11D44DE818AF12018998AA@troon.Credant.Com>
In-Reply-To: <6EBAD6646B5F934E8E11D44DE818AF12018998AA@troon.Credant.Com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Chris Mumford on 8/22/2005 3:02 PM:
> I came across what I believe is an interesting bug. 
> 
> Let's say I have a file in a directory named "foo.exe". If I run "mkdir
> foo" then it succeeds. If I then run "mkdir -p foo" then it fails. If I
> remove foo.exe then "mkdir -p foo" succeeds.
> 
> The error message contains says "foo exists but is not a directory".

Bugs in the cygwin packaging of coreutils should be reported to cygwin AT
cygwin.com.  Setting the reply-to: accordingly.

What you are seeing is caused by cygwin's auto-.exe extension behavior,
and is not a bug in the upstream sources.  The problem is that on cygwin,
stat(2) on "foo" returns information for "foo.exe" if "foo" did not exist
(a cygwin design decision that helps 99% of the time, since Windows does
not like executables without extensions but Unix does; but it interferes
in this case).  The code path for `mkdir -p' uses stat(2) while the code
path for regular `mkdir' does not.  Now that you've reported it, the
cygwin team will probably write a cygwin-specific patch to `mkdir -p' to
ignore stat(2) if it appended .exe.

- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDCwsJ84KuGfSFAYARArlHAJ9wx80UqnFoQL/iiYMUUTOo/9vp+wCgo9Cf
/sdnHtBseRG5sGtQ8+aEddQ=
=0vDO
-----END PGP SIGNATURE-----

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

