delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/03/10/05:45:42

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Wed, 10 Mar 2010 11:45:28 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: allow executing a path in backslash notation
Message-ID: <20100310104528.GZ6505@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <720660 DOT 16774 DOT qm AT web88302 DOT mail DOT re4 DOT yahoo DOT com> <20100310092536 DOT GS6505 AT calimero DOT vinschen DOT de> <e6940be71003100203h297db699ua44ae9086bf64a72 AT mail DOT gmail DOT com> <4B9775C2 DOT 8000300 AT towo DOT net>
MIME-Version: 1.0
In-Reply-To: <4B9775C2.8000300@towo.net>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

On Mar 10 11:34, Thomas Wolff wrote:
> On 10.03.2010 11:03, Ilya Beylin wrote:
> >The problem is that DOS paths are treated differently, even within the
> >same program.
> >Take for instance, bash:
> >
> >$ builtin test -x "$WINDIR\system32\cmd.exe"&&  echo ok
> >yes
> >$ builtin exec "$WINDIR\system32\cmd.exe" /C echo ok
> >-bash: exec: C:\WINDOWS\system32\cmd.exe: not found
> >
> >That makes a lot of headache both for users and for programmers who
> >have to remember about all such special cases
> Not really for programmers, as Corinna has demonstrated, unless you
> refer to shell script programmers.
> So there's fewer special situations in which this might be relevant,
> I think.
> And the limitation doesn't need "exec" to be involved but applies to
> "normal" invocation as well as file name expansion, too.
> Surprising (and the trigger of my response) is the observation that
> a single "/" substituted for one backslash, i.e. a mixed style path
> name, changes the situation:
> 
> $ echo D:\\cygwin17\\bin\\min*.exe
> D:\cygwin17\bin\min*.exe
> $ echo D:\\cygwin17\\bin/min*.exe
> D:\cygwin17\bin/mined.exe D:\cygwin17\bin/mintty.exe
> 
> So maybe for consistency it might be worth patching bash to fully
> support DOS style paths?

As far as Cygwin is concerned, it's a deliberate decision to treat DOS
paths different from POSIX paths.  It all starts with DOS paths
circumventing the mount table.  From there we have to assume certain
properties.  The result is that a DOS path doesn't get the full
attention a POSIX path gets.  Eventually Cygwin is a POSIX layer, so use
POSIX paths.  The fact that DOS paths work as well is nice, but not the
main feature of Cygwin.  For problematic cases, use cygpath.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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