delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/07/02/15:32:58

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Fri, 2 Jul 2004 15:32:28 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Trevor Baker <trevor AT alphatrade DOT com>
cc: cygwin AT cygwin DOT com
Subject: RE: "cygpath -w ." returns ".\" instead of "."
In-Reply-To: <EEEEICLFFGBGJBFBMGLDMEDCCLAA.trevor@alphatrade.com>
Message-ID: <Pine.GSO.4.58.0407021529150.22362@slinky.cs.nyu.edu>
References: <EEEEICLFFGBGJBFBMGLDMEDCCLAA DOT trevor AT alphatrade DOT com>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.39

Ugh, top posting...  Oh, well...

FYI, as a workaround, "cygpath -w ./", "cygpath -m ./", and "cygpath -u
./" should work consistently.

If you feel that the current behavior is a bug, feel free to submit a
patch to the code that does the transformation (in winsup/cygwin/path.cc,
the definition of path_conv::check).  See <http://cygwin.com/contrib.html>
for details.
HTH,
	Igor

On Fri, 2 Jul 2004, Trevor Baker wrote:

> Okay point taken. Stupid trivial script aside...
>
> Why does:
> "cygpath -w ." return ".\" instead of "."
> "cygpath -m ." return "./" instead of "."
>
> And why does:
> "cygpath -w dir" return "dir" instead of "dir\"
> "cygpath -m dir" return "dir" instead of "dir/"
>
> Shouldn't:
> "cygpath -w ."
> "cygpath -m ."
> "cygpath -u ."
>
> return "." in all three cases?
>
> I don't understand the difference/reasoning.
>
> thanks,
> Trev
>
> > -----Original Message-----
> > From: cygwin-owner On Behalf Of Trevor Baker
> > Sent: 01 July 2004 22:43
>
> > the following
> > trivial script:
>
>   Even a trivial script can have bugs in it!
>
> > #----------
> > #!/bin/sh
> >
> > BASEDIR=`cygpath -w .`
>
>   So here on line one, you're asking for a windoze-format path.
>
> > FILE="$BASEDIR/out.txt"
>
>   And here on line two, you're concatenating a unix-style path to the
> windoze-style path you previously asked for.  That looks like a bug to me.
>
> > touch "$FILE"
> > #----------
> >
> > If you run this, $FILE is set to ".\/out.txt" which is not very unix
> > friendly.
>
>   WDDTT!
>
>     cheers,
>       DaveK

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

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