delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/07/14/11:24:29

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:content-type:mime-version:subject:from
:in-reply-to:date:content-transfer-encoding:message-id
:references:to; q=dns; s=default; b=aLgNNxltn3mOzdUh/wm3kSp7rgNg
6XD9zHQrFvm3MH9Adzh/B0ylGbdW4BYBjAjcH3oOfcwznvx2YgvKABAtB6vz9gl+
by9okUbKPg/wMJRjXYJE3DGkno1+h5eTQ2/Zyli9T+jRz2HuTjinKClYqXRq76FK
oleA9i+D1GZomuY=
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:content-type:mime-version:subject:from
:in-reply-to:date:content-transfer-encoding:message-id
:references:to; s=default; bh=t+7ZQE9I0GXsFCGCRRRpf8LaeOA=; b=dN
pzdOoqDQHhLbpFVYgQWEPiyZq51x9Vd1cLBzm+b+iyRdczhP7zKWOnLSXd8Drkvk
QLwi5kNggQKHXifIwekNNpMJHfjXECZZhTjEsV5Ax9bD4UVmFWogOSb9Gnm3TAqc
jFThH6AjySRgzctELiP/BqRxAqfYgZipVX1vtvNd0=
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=0.9 required=5.0 tests=AWL,BAYES_50,KAM_INFOUSMEBIZ,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=Documents, brienpub AT gmail DOT com, oberstein, Oberstein
X-HELO: etr-usa.com
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
Subject: Re: cygpath -w 'a"b'
From: Warren Young <wyml AT etr-usa DOT com>
In-Reply-To: <000b01d1dddd$174e66a0$45eb33e0$@gmail.com>
Date: Thu, 14 Jul 2016 09:24:13 -0600
Message-Id: <C32E46D2-3984-427D-B6B6-50BF252FC8A1@etr-usa.com>
References: <000b01d1dddd$174e66a0$45eb33e0$@gmail.com>
To: The Cygwin Mailing List <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u6EFOQOl021097

On Jul 14, 2016, at 8:36 AM, Brien Oberstein <brienpub AT gmail DOT com> wrote:
> 
> cygpath -w 'a"b' doesn't seem to translate the double quotes into a windows
> accesible file name.

Double quotes are illegal on NTFS:

  https://msdn.microsoft.com/library/windows/desktop/aa365247.aspx

> what is the proper way to translate from cygwin
> filenames with special mapped characters (eg " and : )?

If you look at such a file name in Explorer, Cygwin (?) seems to be mapping double-quotes to U+F022, which is currently not defined within Unicode:

  http://www.fileformat.info/info/unicode/char/f022/

That’s fine as far as Cygwin goes, but it still isn’t going to make native Windows programs believe that double-quotes are legal in file names.

While playing with all of this, I stumbled across an actual cygpath bug:

  $ mkdir 'the "foo" directory’
  $ cygpath -w 'the "foo" directory/' | od -c
  0000000   t   h   e       "   f   o   o 357 200 242       d   i   r   e
  0000020   c   t   o   r   y   \  \n
  0000027

That is, it translates the second double-quote only.

Attempting something more like what Brien talks about also fails:

  $ mkdir 'a"b'
  $ explorer 'a"b'                        # opens my Documents folder!
  $ explorer "$(cygpath -w 'a"b')"        # ditto
  $ explorer $(echo -e "a\xEF\x80\xA2b")  # opens expected folder

Strange stuff.
--
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