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: Tue, 28 Feb 2017 20:15:00 -0000	[thread overview]
Message-ID: <bcb81145-3bae-4dc3-88ab-5635543fca18@gmail.com> (raw)
In-Reply-To: <0D835E9B9CD07F40A48423F80D3B5A704BBEF6E6@USA7109MB022.na.xerox.net>

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

      reply	other threads:[~2017-02-28 20:15 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
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 message]

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=bcb81145-3bae-4dc3-88ab-5635543fca18@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).