www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/08/26/11:29:58

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=x3p+0OJrTNRKkkk/
ZVHejqG1DnvEmBIRiEjmtnxQs2034kv0z6Ufjg3kAcK5LcKeG/QXCD881Vp4g7Xs
+FjHg6EeZ5j/Ng5zW+gpLMOCaAQrF/Vy0nycyjGEqdLr39yq6xpjZp3ZQsioyCqG
TbQ0V3BfL9/O9O29HPqX60Kr4Oo=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=75czgsLtZFCcdzJe9GGSEJ
IkKdo=; b=q9PrYHCwwTY1SHH6G60PmNAk9SCLIF+ed8ddVgxQmT7P5KhxNX9VlE
d+98qRzAf5GgasQ4mrVwq00/0F0osj0o3jkey96zbLkfX3z/EeNGYKUogJIr9IfY
vtycYozukj+3OjKLDT23HT3jfwHoStLGT06sPfXdxwN3sL5EEsrRU=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=overwrite, dilemma, strokes, food
X-HELO: mout.gmx.net
Subject: Re: cygpath -w and .exe magic
To: cygwin AT cygwin DOT com
References: <0D835E9B9CD07F40A48423F80D3B5A704BB92639 AT USA7109MB022 DOT na DOT xerox DOT net>
From: Herbert Stocker <hersto AT gmx DOT de>
Message-ID: <57C06058.4040800@gmx.de>
Date: Fri, 26 Aug 2016 17:29:28 +0200
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101 Thunderbird/38.1.0
MIME-Version: 1.0
In-Reply-To: <0D835E9B9CD07F40A48423F80D3B5A704BB92639@USA7109MB022.na.xerox.net>
X-UI-Out-Filterresults: notjunk:1;V01:K0:Pxq+1hQGhyM=:wi8hfu23iWyMURg/U/nV2z z4OuDbnaEnJgDbqm5IkN/HllNvV44ruZruRqIKw3shhupr+jkMGi9DZUremriL6Ho+nXjFlXE axtVkJ1oxzq6v5TsjShxFCXCbucylADhN2Dfh7bkd7qziCvttw38fcVQY8SmxHOQQQnsLwnLv c/M0zhKarCFUd27SefbP39qByze6u2BL4sabcZVW8FBwxGL74RIKaIAzGvqukycKNPOmKPNkW zaGWl/yhoCofvp4nhqN5SuGEvIjjdWEl9ewNQPsK/oJe1ejesIqN2027WTtgt70rQjptCskZe G7s9na8VYNBvfnAsabgHLKdV81SgTTKtOVj3b/TfIZXT3v7xk36HDVFNaXfDjAxNSEAYHUO5i 17pR35RfKayMWHlIclksncxv2kIwGKV1YdTfuU+D1AFf4s3jRD3rk/dU4swWYK0FKIAPjeskm 7g+L1vfyE9gFJZQtjj+GAiRDnQhGi3jdNcSuCcYKgJvVl78dHaUIFsMTzGxYTI1fXBN1vQUM8 25ymIl2dVkm/Xaa6V3YLZ6Ao52e7zjy3e2uUcxEQTfAziuA6ETX27+UEJivBOCTmh0BhaSCEf eAqDP68z/qj1dgmPZdhChlAvOgRr/0S8yZt8Zo0BaAeTgbDyWUcaRROtbpfyCpIVDnue4xS5S nhjwBbHPnl1kbGP0sLqcrKHffKdqwwCtEvOL6ylGXD8tL/41WF9wVNcqP34nzwudqox7EmKpM l9wI197Lo2hOiPY5hC6Nt/3Ev2rf5Ij164sTAbEgON1mT49oGvAnb4BJAZOMiiBnAy44asuUa dE1c2lR
X-IsSubscribed: yes

On 26.08.2016 15:08, Nellis, Kenneth wrote:
> Dear Cygwin Community,
>
> $ ls -l
> total 60
> -rwxr-x--- 1 knellis Domain Users 60927 Aug 26 08:57 hello.exe
> $ ./hello
> Hello, world!
> $ cygpath -w hello
> hello
> $
>
> The purpose of cygpath -w, it seems to me, is to provide
> to Windows a valid path given a Posix path.
>
> Given executable file foo.exe, which Cygwin allows to be
> referenced simply as foo, should not: cygpath -w foo
> return: foo.exe
> instead of: foo
> ?
>
> Passing foo to a Windows application will certainly
> be a problem. I recognize this might be considered a
> change of scope for the program, but I think the tool
> should do the .exe magic rather than pass off this
> responsibility to the user. Food for thought.
>

Sounds reasonable, but why shouldn't one have to say .exe
if they mean .exe?
That principle makes things easy.

Just to illustrate a complication of that approach:
Imagine you want to tell a program to safe its data to file foo
and cygpath sees that there is a file Foo.exe, it will make the
Windows program overwrite Foo.exe instead.


And as far as i understand, the reason why Cygwin added this
automatic addition of .exe is not to safe the user 4 key strokes,
but because some programs cannot live without it - i remember
Corinna saying that one cannot run Cygwin programs from cmd.exe
if they don't have the .exe appended - and requiring to specify
the exact name of an executable, i.e. with the .exe would break
each and every script or executable that were written with only
POSIX in mind. They say cp or bash, but not cp.exe or bash.exe .

So Cygwin did this not to make it easy for users,
but out of a dilemma:
   make Cygwin executables available to the Windows world
   vs. not breaking all POSIX programs.

And if you use cygpath, you are writing code for the Windows
environment, and then you can add the .exe where its needed
i think.


best regards,

Herbert Stocker













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


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019