public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* cygpath (reprised)
@ 2017-02-21 17:22 Nellis, Kenneth (Conduent)
  2017-02-21 18:05 ` Andrey Repin
  0 siblings, 1 reply; 10+ messages in thread
From: Nellis, Kenneth (Conduent) @ 2017-02-21 17:22 UTC (permalink / raw)
  To: cygwin

I followed and understood the discussion to all the recent cygpath postings, 
so I understand and expect the following:

$ cygpath -w 'a*b' | od -An -tx1c
  61  ef  80  aa  62  0a
   a 357 200 252   b  \n
$

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?

$ uname -svr
CYGWIN_NT-6.1 2.7.0(0.306/5/3) 2017-02-12 13:18
$ cygpath --version
cygpath (cygwin) 2.7.0
Path Conversion Utility
Copyright (C) 1998 - 2017 Cygwin Authors
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$

--Ken Nellis

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: cygpath (reprised)
  2017-02-21 17:22 cygpath (reprised) Nellis, Kenneth (Conduent)
@ 2017-02-21 18:05 ` Andrey Repin
  2017-02-21 18:22   ` Nellis, Kenneth (Conduent)
  0 siblings, 1 reply; 10+ messages in thread
From: Andrey Repin @ 2017-02-21 18:05 UTC (permalink / raw)
  To: Nellis, Kenneth (Conduent), cygwin

Greetings, Nellis, Kenneth (Conduent)!

> I followed and understood the discussion to all the recent cygpath postings, 
> so I understand and expect the following:

> $ cygpath -w 'a*b' | od -An -tx1c
>   61  ef  80  aa  62  0a
>    a 357 200 252   b  \n
> $

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


-- 
With best regards,
Andrey Repin
Tuesday, February 21, 2017 21:01:01

Sorry for my terrible english...


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: cygpath (reprised)
  2017-02-21 18:05 ` Andrey Repin
@ 2017-02-21 18:22   ` Nellis, Kenneth (Conduent)
  2017-02-25 16:38     ` cyg Simple
  0 siblings, 1 reply; 10+ messages in thread
From: Nellis, Kenneth (Conduent) @ 2017-02-21 18:22 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1369 bytes --]

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

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
$

But I don't have a dog in this fight, either.

(Replying to a direct reply from Mr. Repin rather than from the list, so hoping
this doesn't break message threading.)

--Ken Nellis
\0ТÒÐÐ¥\a&ö&ÆVÒ\a&W\x06÷'G3¢\x02\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒ÷\a&ö&ÆV×2æ‡FÖÀФd\x15\x13¢\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒöf\x17\x12ðФFö7VÖVçF\x17F–öã¢\x02\x02\x02\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒöFö72æ‡FÖÀÐ¥Vç7V'67&–&R\x06–æfó¢\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒöÖÂò7Vç7V'67&–&R×6–×\x06ÆPРÐ

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: cygpath (reprised)
  2017-02-21 18:22   ` Nellis, Kenneth (Conduent)
@ 2017-02-25 16:38     ` cyg Simple
  2017-02-26  1:20       ` Andrey Repin
  2017-02-27 14:03       ` Nellis, Kenneth (Conduent)
  0 siblings, 2 replies; 10+ messages in thread
From: cyg Simple @ 2017-02-25 16:38 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: cygpath (reprised)
  2017-02-25 16:38     ` cyg Simple
@ 2017-02-26  1:20       ` Andrey Repin
  2017-02-28 19:56         ` cyg Simple
  2017-02-27 14:03       ` Nellis, Kenneth (Conduent)
  1 sibling, 1 reply; 10+ messages in thread
From: Andrey Repin @ 2017-02-26  1:20 UTC (permalink / raw)
  To: cyg Simple, cygwin

Greetings, cyg Simple!

> Also a : isn't a valid character for a name in Windows.  Cygwin uses
> some magic to represent it in UNICODE format though.

It isn't a valid file "name" character, yes, but it is still a meaningful
character in pathname under windows.
Just the meaning of it is far from regular file name semantics.


-- 
With best regards,
Andrey Repin
Sunday, February 26, 2017 04:12:43

Sorry for my terrible english...


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: cygpath (reprised)
  2017-02-25 16:38     ` cyg Simple
  2017-02-26  1:20       ` Andrey Repin
@ 2017-02-27 14:03       ` Nellis, Kenneth (Conduent)
  2017-02-28 20:15         ` cyg Simple
  1 sibling, 1 reply; 10+ messages in thread
From: Nellis, Kenneth (Conduent) @ 2017-02-27 14:03 UTC (permalink / raw)
  To: cyg Simple, cygwin

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.

I read this as converting one format to the other.

--Ken Nellis

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: cygpath (reprised)
  2017-02-26  1:20       ` Andrey Repin
@ 2017-02-28 19:56         ` cyg Simple
  2017-03-01 13:20           ` Andrey Repin
  0 siblings, 1 reply; 10+ messages in thread
From: cyg Simple @ 2017-02-28 19:56 UTC (permalink / raw)
  To: cygwin, cyg Simple

On 2/25/2017 8:13 PM, Andrey Repin wrote:
> Greetings, cyg Simple!
> 
>> Also a : isn't a valid character for a name in Windows.  Cygwin uses
>> some magic to represent it in UNICODE format though.
> 
> It isn't a valid file "name" character, yes, but it is still a meaningful
> character in pathname under windows.
> Just the meaning of it is far from regular file name semantics.
> 

Not when specifying ./a:b which was the example being discussed.

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: cygpath (reprised)
  2017-02-27 14:03       ` Nellis, Kenneth (Conduent)
@ 2017-02-28 20:15         ` cyg Simple
  0 siblings, 0 replies; 10+ messages in thread
From: cyg Simple @ 2017-02-28 20:15 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: cygpath (reprised)
  2017-02-28 19:56         ` cyg Simple
@ 2017-03-01 13:20           ` Andrey Repin
  2017-03-01 14:33             ` cyg Simple
  0 siblings, 1 reply; 10+ messages in thread
From: Andrey Repin @ 2017-03-01 13:20 UTC (permalink / raw)
  To: cyg Simple, cygwin

Greetings, cyg Simple!

> On 2/25/2017 8:13 PM, Andrey Repin wrote:
>> Greetings, cyg Simple!
>> 
>>> Also a : isn't a valid character for a name in Windows.  Cygwin uses
>>> some magic to represent it in UNICODE format though.
>> 
>> It isn't a valid file "name" character, yes, but it is still a meaningful
>> character in pathname under windows.
>> Just the meaning of it is far from regular file name semantics.
>> 

> Not when specifying ./a:b which was the example being discussed.

We were discussing "a:b", not "./a:b".


-- 
With best regards,
Andrey Repin
Wednesday, March 1, 2017 16:11:45

Sorry for my terrible english...


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: cygpath (reprised)
  2017-03-01 13:20           ` Andrey Repin
@ 2017-03-01 14:33             ` cyg Simple
  0 siblings, 0 replies; 10+ messages in thread
From: cyg Simple @ 2017-03-01 14:33 UTC (permalink / raw)
  To: cygwin



On 3/1/2017 8:12 AM, Andrey Repin wrote:
> Greetings, cyg Simple!
> 
>> On 2/25/2017 8:13 PM, Andrey Repin wrote:
>>> Greetings, cyg Simple!
>>>
>>>> Also a : isn't a valid character for a name in Windows.  Cygwin uses
>>>> some magic to represent it in UNICODE format though.
>>>
>>> It isn't a valid file "name" character, yes, but it is still a meaningful
>>> character in pathname under windows.
>>> Just the meaning of it is far from regular file name semantics.
>>>
> 
>> Not when specifying ./a:b which was the example being discussed.
> 
> We were discussing "a:b", not "./a:b".

Then you need to re-read the elided content.  An example of ./a:b was
given and what I responded to.

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-03-01 14:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-21 17:22 cygpath (reprised) 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
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

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