delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/08/08/02:42:38

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Fri, 8 Aug 2008 16:41:44 +1000 (EST)
From: Luke Kendall <luke DOT kendall AT cisra DOT canon DOT com DOT au>
Subject: RE: Bizarre Cygwin/Explorer/paths problem half-solved
To: cygwin AT cygwin DOT com
In-Reply-To: <23B84CD357BC48BBABA51C730D921AA7@DFW5RB41>
MIME-Version: 1.0
Message-Id: <20080808064144.94C9485E51@pessard.research.canon.com.au>
X-IsSubscribed: yes
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  4 Aug, Gary R. Van Sickle wrote:
>  Hi Luke,
>  
> > I discovered today that if I try to run Windows Explorer from 
> > the Cygwin command line, and give it a pathname with spaces, 
> > it fails, but if I give the same command line to a cmd.exe 
> > command line, Explorer works!
> > 
> > I.e. from Bash, explorer fails with an error message like 
> > "The path '/e,c:\temp\space dir' does not exist or is not a 
> > directory."
> > 
> > I've tried every quote combo I can.  If I leave off the /e 
> > option then it does open the directory, but without the side 
> > pane (which is what you'd expect with the /e option omitted).
> > 
>  
>  I've had this little gem in my .bash_profile for ages, and it's never failed
>  me regardless of the craziness of the path:
>  
>  # Easy "Explorer here" command
>  x()
>  {
>  	if [ "${1}" = "" ];
>  	then
>  		XPATH=".";
>  	else
>  		XPATH="$(cygpath -w "${1}")";
>  	fi
>  	explorer $XPATH & disown %-
>  }
>  
>  No tree view though.  Lessee what happens if I add a "/e,":
>  
>  # Easy "Explorer here" command with tree control on the left
>  x()
>  {
>  	if [ "${1}" = "" ];
>  	then
>  		# No parameter given, open Explorer in the current bash
>  directory.
>  		XPATH=".";
>  	else
>  		# Open the given path.
>  		XPATH="$(cygpath -w "${1}")";
>  	fi
>  	explorer /e,$XPATH & disown %-
>  }
>  
>  ...yep, that works like a charm too.

True, and thanks, that's interesting!


Don't try this variant, though, since it doesn't work:

    explorer /e,"$XPATH" & disown %-

What happens if you try that innocuous-looking variant is that Cygwin
(or bash?) normalises the path /e,... to a windows path first, producing
\e,...

Well, I though that snippet of info interesting enough to share.

Regards,

luke


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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