delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/02/11/13:20:02

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:from:subject:references:to:reply-to:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=yoRBG89cPyetAnKq
StGIpzTg5LqphOunMh+pwAoNH6lfSWPu1xww72mHqmyqQdVrvrwlD22aL1OdhZN0
Y90c4VS3NXSmIRH+HwYLA/KZF7EuLCQXxyU79w56mcv5seXaMM2cs4jbYp1z+yeV
xr+mII4OmVyesL2WVzoIyLoGJAM=
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:from:subject:references:to:reply-to:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=1UO40g/KF0MNg9fkLUG0RU
ABSJg=; b=ybwshdOvhVqyVnBUPlbpT1ao8iyEqMZvoHH/6/tIQKTAfBzF3/15pJ
OdTDEQEHx8iBu3f62a/x2Qu7lgQbU+hQp9OVOBo4AADM51r9XPFb9dQ69gkhQuVW
hZQ/jfauTVP9ru/7hEkeG6V49zUNF45lWqPy1IfOEIW6xxvrck3qQ=
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=1.1 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=H*R:D*ca, H*r:sk:smtp-ou, Hx-spam-relays-external:64.59.134.9, H*RU:64.59.134.9
X-HELO: smtp-out-no.shaw.ca
X-Authority-Analysis: v=2.2 cv=JLBLi4Cb c=1 sm=1 tr=0 a=WqCeCkldcEjBO3QZneQsCg==:117 a=WqCeCkldcEjBO3QZneQsCg==:17 a=IkcTkHD0fZMA:10 a=0noi5t9V0Qqn20cm9WgA:9 a=QEXdDO2ut3YA:10
From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Subject: Re: cygpath
References: <91DCAC3CB99C724EB365BB64677FBE7B139A86 AT MX204CL04 DOT corp DOT emc DOT com>
To: cygwin AT cygwin DOT com
Reply-To: Brian DOT Inglis AT SystematicSw DOT ab DOT ca
Message-ID: <8cce6b9e-72cd-319c-dd1d-1d6be37bd782@SystematicSw.ab.ca>
Date: Sat, 11 Feb 2017 11:19:43 -0700
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: <91DCAC3CB99C724EB365BB64677FBE7B139A86@MX204CL04.corp.emc.com>
X-CMAE-Envelope: MS4wfP9DlsmciR6ObYmozv7ipKt1KMEm7mP1i18sxhg3/XqaXfXvDmS5/+juJTY66Ukzeo8gQxcOk8c62+bCKHYAM/Osgr/SQ3GRkML29iTktsvDTOo/0GXy qHqwu/3fTcTLYu7kz7GJTUWqM3s3A/DL5xpEcguAsjYsQ+EPegM2dvfuVdihMqJwn70ExwuhtEv4Iw==
X-IsSubscribed: yes

On 2017-02-10 12:07, Gluszczak, Glenn wrote:
> Isn’t this a defect in cygpath?  Looks like memory corruption.
> %%%cygpath -w /usr/tmp/*
> C:\cygwin\usr\tmp\
> %%%cygpath -w /usr/non-existent/*
> C:\cygwin\usr\non-existent\�[W��

For proper interpretation of a Unix path name, all but the last component must
exist, and that is expected to be a file system entry which will be created.

Unix wild cards are looked up and expanded by the shell prior to command 
execution, so are expected to be existing path names used as input to a 
command, otherwise they are passed to the command as is: if used as an input 
path name, it should not exist; if used as an output path name, it will be 
created if all but the last component exist, otherwise it should fail as a 
directory component in the path does not exist.

One exception is mkdir -p, and there may be some similar commands which will
create multiple explicit directory tree entries in a path.

AFAIK there are no Unix commands which allow output wild card path names and 
interpret them as being the same as the input names, but there are some cmd 
shell commands which allow or expect this e.g. RENAME *.bat *.cmd, which on 
Unix has to be done with multiple commands in a a loop e.g.

	for bat in *.bat; do mv $bat ${bat%.bat}.cmd; done

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

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