Mail Archives: cygwin/2010/03/12/10:17:53
--------------enigE4A22C099CDBB1E0ACC64D05
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On 03/12/2010 08:03 AM, Nellis, Kenneth wrote:
> I wonder if there is more explanation available about how Cygwin
> handles the .exe extension than I found in the User's Guide.
>=20
> http://cygwin.com/cygwin-ug-net/
>=20
> I'm running 1.7.1.
> In particular, I find it odd that moving a binary executable
> toggles whether or not it has the .exe extension. Consider:
>=20
> $ ls -l
> total 8
> -rwxr-x--- 1 knellis knellis 4096 2010-03-12 09:08 a.exe
> -rwxr-x--- 1 knellis knellis 4096 2010-03-12 09:37 b
> $ mv a c
> $ mv b d
> $ ls -l
> total 8
> -rwxr-x--- 1 knellis knellis 4096 2010-03-12 09:08 c
> -rwxr-x--- 1 knellis knellis 4096 2010-03-12 09:37 d.exe
> $
This is an area of active conversation; if you would like, you can test
the latest snapshot and the experimental coreutils 8.4-1 to see if the
behavior is more intuitive (that is, there are more situations where
.exe is preserved across file moves or copies, and fewer places where
.exe is appended on a whim if the source didn't have one).
In general, cygwin does not care if the .exe is missing, but other
programs (particularly cmd) do, so it is better if PE-COFF files are
given the .exe extension. But implementing it is tricky - for example,
in the case of 'cat a > b', there is no way to tell at the time when b
is created whether it will be populated with PE-COFF contents (that is,
no way to tell whether the source was a literal 'a' or 'a.exe'), so you
will not get an .exe in that case.
>=20
> I have a mixture of binaries with and without the .exe extension
> and wonder if the mixture will somehow bite me one day.
Hopefully not, but feel free to report any test cases where things need
to be improved.
--=20
Eric Blake eblake AT redhat DOT com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
--------------enigE4A22C099CDBB1E0ACC64D05
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAkuaWtwACgkQ84KuGfSFAYC8QACg0H6M846HLSUfkB1L56wHQGFG
Gx4AoLFYpxQR6FfzPGeTdjw/Xf478itt
=6wBe
-----END PGP SIGNATURE-----
--------------enigE4A22C099CDBB1E0ACC64D05--
- Raw text -