X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_THREADED,MSGID_FROM_MTA_HEADER,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Message-ID: Date: Tue, 10 Jul 2012 18:54:06 +0200 From: Aaron Schneider User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Inconsistence on file operation when the name already exists with exe extension References: <20120709154456 DOT GA6696 AT ednor DOT casa DOT cgf DOT cx> <1BBEF94B6B46E54980290D150A6F2EDD20C950F5 AT SN2PRD0610MB396 DOT namprd06 DOT prod DOT outlook DOT com> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit 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 On 10/07/2012 17:24, Earnie Boyd wrote: > On Tue, Jul 10, 2012 at 4:34 AM, Aaron Schneider >> You're right that cygwin shell tries to emulate bash, I just twisted things. >> > > You're still wrong. Cygwin is a POSIX library for Windows. Bash is a > shell capable of being built with that POSIX library for use on > Windows but it isn't an emulation of Bash, it *is* Bash. Other shells > available on *nix is also available for Cygwin. > >> The problem is that in unix executables don't have extension but they actually do in cygwin so I think that's the root of the problem. >> > > They don't need one in Cygwin either; as a matter of fact it was an > addition to binutils in the second generation of Cygwin that added the > .exe to the executable because it was more natural for Windows and > Windows at the time wouldn't execute the binary without the .exe > extension. > >> Probably compiling binaries under cygwin without the exe extension, like unix, is not an alternative, or is it? Cygwin may detect if it is executable checking if it's PE format; if it is perl script. Just check if file is present in path or run. /file > > False. It is wholly possible, you just have to pass the correct flags > to the linker process. Current windows versions since at least XP and > maybe before would run files that did not contain a .exe extension. > I don't see how you can run a PE executable from windows shell (cmd.exe) directly without the exe extension. I've just tried it in several ways and always prompts me the "Open with..." dialog instead of directly running it because treats it as data. When you say that Windows XP and above can run an executable without extension, you are talking about running it from windows shell. But I was referring in the end to the cygwin terminal (C:\cygwin\bin\mintty.exe -) that I believe can run exe without extension even in older versions of windows, because it's bash that launches it as you said before. That's being said because I expect users to run commands from the cygwin terminal. The exe extension is needed if you want to run the linux commands directly from the windows shell directly (c:\cygwin\bin\ and other bash PATHs should be exported to the windows PATH to run them directly from windows shell, but you will mix things up) -- 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