From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82228 invoked by alias); 28 Feb 2017 20:15:34 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 81835 invoked by uid 89); 28 Feb 2017 20:15:27 -0000 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 Received: from mail-it0-f45.google.com (HELO mail-it0-f45.google.com) (209.85.214.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 Feb 2017 20:15:25 +0000 Received: by mail-it0-f45.google.com with SMTP id 203so85634681ith.0 for ; Tue, 28 Feb 2017 12:15:26 -0800 (PST) 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) Received: from [192.168.0.6] (d27-96-48-76.nap.wideopenwest.com. [96.27.76.48]) by smtp.gmail.com with ESMTPSA id t7sm1209134ioe.22.2017.02.28.12.15.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Feb 2017 12:15:24 -0800 (PST) Subject: Re: cygpath (reprised) To: cygwin@cygwin.com References: <0D835E9B9CD07F40A48423F80D3B5A704BBEF6E6@USA7109MB022.na.xerox.net> From: cyg Simple Message-ID: Date: Tue, 28 Feb 2017 20:15:00 -0000 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> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00354.txt.bz2 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