public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: cyg Simple <cygsimple@gmail.com>
To: cygwin@cygwin.com
Subject: Re: cygpath (reprised)
Date: Sat, 25 Feb 2017 16:38:00 -0000	[thread overview]
Message-ID: <a012307e-c235-8571-97e8-019719058366@gmail.com> (raw)
In-Reply-To: <0D835E9B9CD07F40A48423F80D3B5A704BBEEB6F@USA7109MB022.na.xerox.net>

On 2/21/2017 1:22 PM, Nellis, Kenneth (Conduent) wrote:
> From: Andrey Repin 
>>> But, consider the following:
>>
>>> $ cygpath -w a:b | od -An -tx1c
>>>   41  3a  62  0a
>>>    A   :   b  \n
>>> $
>>
>>> Instead of the special character colon (:), shouldn't cygpath be showing
>>> something in the Unicode Private Use area?
>>
>> No, it shouldn't.
>> You've requested a name "b" in the current directory on the disk "A:", or
>> a file substream "b" of the file "a".
>> Both are valid system paths.
> 
> Right. Thanx. I wondered why the "a" got up-cased.
> 
> 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.
Also a : isn't a valid character for a name in Windows.  Cygwin uses
some magic to represent it in UNICODE format though.

> Also, in the following, I would expect cygpath to figure out that I *am not* 
> specifying a drive letter:
> 
> $ cygpath -w ./a:b | od -An -tx1c
>   41  3a  62  0a
>    A   :   b  \n
> $
> 

Consider the following as what should happen with "./a:b" but the
current result of  "a:b" could already be considered correct.  With the
following I think the output give fro "./a:b" is incorrect.  Not
withstanding the argument for relational output of the windows path.

$ cygpath -w ../a:b | od -An -tx1c
  43  3a  5c  6f  70  74  5c  63  79  67  77  69  6e  36  34  5c
   C   :   \   o   p   t   \   c   y   g   w   i   n   6   4   \
  68  6f  6d  65  5c  61  ef  80  ba  62  0a
   h   o   m   e   \   a 357 200 272   b  \n

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

  reply	other threads:[~2017-02-25 16:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-21 17:22 Nellis, Kenneth (Conduent)
2017-02-21 18:05 ` Andrey Repin
2017-02-21 18:22   ` Nellis, Kenneth (Conduent)
2017-02-25 16:38     ` cyg Simple [this message]
2017-02-26  1:20       ` Andrey Repin
2017-02-28 19:56         ` cyg Simple
2017-03-01 13:20           ` Andrey Repin
2017-03-01 14:33             ` cyg Simple
2017-02-27 14:03       ` Nellis, Kenneth (Conduent)
2017-02-28 20:15         ` cyg Simple

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a012307e-c235-8571-97e8-019719058366@gmail.com \
    --to=cygsimple@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).