delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/02/28/15:15:51

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=Nu1IOiaNkp7YL/KS
xCgV35EaLrb4RS69OAOa8vtFnB/Mlt2dmUHU4euMLdiwFSAGNok2K3oeXyKEU7Z2
I8fd14IH8OJNsU3MVJwFy4vvOiJqxXCcWoO5z1n/71WRsZauAzvqGZ/+RUPDt4xP
MUyoVaRlQT5dpjMkKoZmY2+eegc=
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=6LHUWOqCbkS5bAmnwtXKlM
Ycxf4=; b=pse0Zkr+NknN3hwR0Qac7/P384Gp5hc4opU4faADehb4+0OYRAbqRC
/sasQVnIGXVf1zqFRihSmef1RSLrEU1xLE+FRLG684bqs08fIBPGniiYv4MeGYv+
3Nfp9MLiOwhoxoQAad1jYOHoBzQB5/qS2IkESzoQM/J9Nf6fRvxUU=
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.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=battle, H*MI:sk:0D835E9, letter, wish
X-HELO: mail-it0-f45.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=3HqLKYNOQNZMujNKP6XTJqKdxPjUlivRXocGLEnCxDc=; b=iD0Zm6mBriU1zwyp6nYNQ2zYpoyL0nOtC0IWYgPuPbyp2Ni25l2AhF2NlR4KEtusAL 2iSbVyaXbpXETCcHAM33sOs6yJ8RyR6Q0RhfgMlhEW6mdweHxHCK7q0XfWn9ibfIOp+A ZDGyCIUULVRJvMtW9TGTbLMdIonJiNnWW91UpkMCixf06JykhO3icadMQo05rp8u+CiS cNwdE0MLLxVqW4AmmwYjtjb5X70t6UXlXtYob3mrIqwftSbTjXyKy1JHdEatF8va3aQI khcEQwZkLhVQ5g75JOHES07Lt11dVU6T11p30nz4vuLvFYQZnXVNAcNc9KoD4x1oLZx6 lyTw==
X-Gm-Message-State: AMke39k2JbmpcrS1UaE6xkX/HpYVBCPJDwUewm2yyYuBtap7n8w13cPK7b2KK5QmQ1tD6A==
X-Received: by 10.36.30.11 with SMTP id 11mr576939itt.54.1488312924594; Tue, 28 Feb 2017 12:15:24 -0800 (PST)
Subject: Re: cygpath (reprised)
To: cygwin AT cygwin DOT com
References: <a012307e-c235-8571-97e8-019719058366 AT gmail DOT com> <0D835E9B9CD07F40A48423F80D3B5A704BBEF6E6 AT USA7109MB022 DOT na DOT xerox DOT net>
From: cyg Simple <cygsimple AT gmail DOT com>
Message-ID: <bcb81145-3bae-4dc3-88ab-5635543fca18@gmail.com>
Date: Tue, 28 Feb 2017 15:15:42 -0500
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1
MIME-Version: 1.0
In-Reply-To: <0D835E9B9CD07F40A48423F80D3B5A704BBEF6E6@USA7109MB022.na.xerox.net>
X-IsSubscribed: yes

On 2/27/2017 9:03 AM, Nellis, Kenneth (Conduent) wrote:
> From: cyg Simple 
>> On 2/21/2017 1:22 PM, Nellis, Kenneth (Conduent) wrote:
>>> I suppose one could argue that, by using -w, that cygpath might assume that it
>>> is converting *from* a POSIX path, and therefore the colon would not indicate
>>> a drive letter--wouldn't that make sense?--but I’ll let someone else take up
>>> that battle. ☺
>>
>> I would almost agree except for the help description of the -w option.
>> ...
> 
> Hmm. Not sure that I see that. From the man page:
> 
> The cygpath program is a utility that converts Windows native filenames to Cygwin 
> POSIX-style pathnames and vice versa.
> 

A general description of the application.  What does the man page say
about the -w option itself?  If nothing then you need to see the cygpath
--help itself.

> I read this as converting one format to the other.

The -w, --windows help text simply says "print windows form of NAMEs
(C:\WINNT)".  This says nothing about what to expect of the conversion
other than it should be a valid windows path.  It doesn't state what
happens with garbage input so you should assume an undefined behavior.

Back to the examples 'a:b' is always valid input while './a:b' isn't
always valid for Windows; although it could be.  So what should happen
for the latter is if possible the `:' character be converted to its
UNICODE representation as NTFS can use that character as part of the
file name. But if not possible you get back what you entered.  This does
leave you with the need to filter the result since garbage begets a
stinking mess.

Always stay away from the corner cases if you wish to never have issues.
 Otherwise be ready to deal with them in continuous rigor.

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