public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Earnie Boyd <earnie@users.sourceforge.net>
To: cygwin@cygwin.com
Subject: Re: Inconsistence on file operation when the name already exists with exe extension
Date: Tue, 10 Jul 2012 18:59:00 -0000	[thread overview]
Message-ID: <CA+sc5mmnJK9q0yA+Ufh2OfFdFJ9jcbThppKKYNdg7Nw49JJ64Q@mail.gmail.com> (raw)
In-Reply-To: <BLU0-SMTP212B1E87711B5FCCCC6A04DCED20@phx.gbl>

On Tue, Jul 10, 2012 at 12:54 PM, Aaron Schneider wrote:
> 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.
>

Ok, it did work but for some reason with XP SP2 a file with out an
extension isn't being executed.  If I copy for example
c:\windows\system32\ping.exe to myping.ping and execute it searching
for google.com then it works as expected.  If I remove .ping the
myping doesn't execute, so much for consistency.

> 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.

Mintty is a terminal.  Bash, Csh, Ksh, Ash, etc all would run in the
Mintty terminal as the shell, you still don't understand the
difference.  The terminal is the interface providing fonts, keyboard
and mouse interactions responding to the window events.  Bash, Csh,
Ksh, etc are shells that act on the commands given it and each has its
own syntax for those commands.

>
> 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)

The .exe isn't needed on the command line.  It is found by the Cygwin
runtime without it and the full file path given to CreateProcess when
it executes it.

-- 
Earnie
-- https://sites.google.com/site/earnieboyd

--
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

  parent reply	other threads:[~2012-07-10 18:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-09 15:23 notstop
2012-07-09 15:45 ` Christopher Faylor
2012-07-09 16:47   ` Steven Hartland
2012-07-09 17:20   ` Aaron Schneider
2012-07-10  5:38     ` Matt Seitz
2012-07-10  8:45       ` Aaron Schneider
2012-07-10 15:25         ` Earnie Boyd
2012-07-10 16:23           ` Larry Hall (Cygwin)
2012-07-10 16:54           ` Aaron Schneider
2012-07-10 17:03             ` Christopher Faylor
2012-07-10 18:59             ` Earnie Boyd [this message]
2012-07-11  0:50             ` Andrey Repin
  -- strict thread matches above, loose matches on Subject: below --
2012-07-08 20:03 Aaron Schneider
2012-07-08 20:19 ` Aaron Schneider
2012-07-08 20:27   ` marco atzeri
2012-07-08 20:37     ` Aaron Schneider
2012-07-09 12:36       ` Earnie Boyd
2012-07-08 20:49     ` Aaron Schneider
2012-07-08 22:43   ` Buchbinder, Barry (NIH/NIAID) [E]
2012-07-08 23:20   ` Andrey Repin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+sc5mmnJK9q0yA+Ufh2OfFdFJ9jcbThppKKYNdg7Nw49JJ64Q@mail.gmail.com \
    --to=earnie@users.sourceforge.net \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).