delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/12/11/10:38:39

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Tue, 11 Dec 2007 10:38:07 -0500 (EST)
From: Igor Peshansky <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Brent <yhbrent AT yahoo DOT com>
cc: cygwin AT cygwin DOT com
Subject: Re: get cygpath to leave relative paths as relative?
In-Reply-To: <308716.36518.qm@web53808.mail.re2.yahoo.com>
Message-ID: <Pine.GSO.4.63.0712111035560.24563@access1.cims.nyu.edu>
References: <308716 DOT 36518 DOT qm AT web53808 DOT mail DOT re2 DOT yahoo DOT com>
MIME-Version: 1.0
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 Mon, 10 Dec 2007, Brent wrote:

> If I execute
>     mypath=`cygpath -w ../`
>     echo $mypath
>
> I get
>     d:\unix\nextVersion\script
>
> OK, d:\unix\nextVersion\script is the correct windows version of the
> path, but it is in absolute form. I would prefer it if cygpath left it
> in relative form, i.e.
>     echo $mypath
> should output
>     ..\
>
> Executing
>     cygpath --help
> indicates that the only related option is -a, but that forces conversion
> to absolute paths, which is the opposite of what I want. It seems,
> unfortunately, as if cygpath has -a on by default and has no way to turn
> it off!
>
> Is this a known bug or implementation quirk in cygpath, or did I
> overlook something? (Web searching on cygpath and "relative path"
> generated a ton of hits, but none out of the first 100 that I looked
> thru seemed related...)

In addition to what Corinna said, if you don't have any symlinks in the
relative path, you should be able to use the forward slash variant without
using cygpath.  All Windows system calls (and most Windows programs)
understand forward slashes just fine.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"That which is hateful to you, do not do to your neighbor.  That is the whole
Torah; the rest is commentary.  Go and study it." -- Rabbi Hillel

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