X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Message-ID: <4C0E5900.8030108@redhat.com> Date: Tue, 08 Jun 2010 08:51:44 -0600 From: Eric Blake User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Lightning/1.0b2pre Mnenhy/0.8.2 Thunderbird/3.0.4 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: 'cp' utility bug when .exe file exist. References: <4C0E4D4D DOT 4010102 AT redhat DOT com> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigFA0CD8AACFBE7657F045DC76" X-IsSubscribed: yes 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 --------------enigFA0CD8AACFBE7657F045DC76 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 06/08/2010 08:43 AM, Steven Collins wrote: > directory as can be demonstrated by a simple "touch foo foo.exe" > command. Both files will be created. Arguably, both should NOT be created, for the same reasons. That is, it is probably worth a patch to make open("foo.exe",O_CREAT|O_EXCL,mode) fail if "foo" exists, and open("foo.exe",O_CREAT,mode) delete "foo" if it exists, effectively renaming "foo" to "foo.exe". > which the magic gets applied and "foo.exe", "foo.bat", You are misunderstanding the magic. It only happens for .exe, and that is because the Unix world is steeped in the tradition of suffix-less executables, but Windows insists on having the .exe suffix for cmd to be able to run an executable. Cygwin goes to various lengths to try to support both, at the expense that you shouldn't have both exist in the same directory. .bat has nothing to do with .exe magic. > There certainly appear to be > inconsistencies within the tools. Yes, and as they get pointed out, we try to make them more consistent. --=20 Eric Blake eblake AT redhat DOT com +1-801-349-2682 Libvirt virtualization library http://libvirt.org --------------enigFA0CD8AACFBE7657F045DC76 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJMDlkAAAoJEKeha0olJ0Nqj5UIAJSaLyD78FaoRCYQSjMELNXs Mz3qgWRhO0/sgsrIGGPWUfcH7xu0EMwCgQku1CxT64be5Negum5yhb8DKK1nUGlh Kdqb6KnxgHKAH/ZvpbQWS84E7VH/yaYLIKuEH5+Jw3c41ETXchi896sZCWy1Lpqe U9TBqCJzffqiPdfOmf5Ffe/0awLZ7ftkO68zQk8p95X7KEgynhxFqZAnwM38AO1K FRo9P1GzDEri3Q47tGhwUpcoxTMix7CFhFtJhEiAYqd9DAXmFQ+yca7B/aNPex/f zrm+0+8Bg4c/u8uoVqf97SV4lJ46mLP4/BP2InwvkfIpt1T8u+A/8KM2nxAIUKM= =woSw -----END PGP SIGNATURE----- --------------enigFA0CD8AACFBE7657F045DC76--