public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* cygpath -u converts quoted UNC paths to local
@ 2019-04-03 16:20 Andrey Repin
  2019-04-03 16:31 ` Corinna Vinschen
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Andrey Repin @ 2019-04-03 16:20 UTC (permalink / raw)
  To: All

Greetings, All!

This can be considered "working by design", but it really imposes some serious
restrictions on interoperability with Cygwin, that I think can be avoided.

...

After some further testing, this seems to be affecting IP-based UNC paths
only.

The essence is this:

$ dir "\\192.168.1.5\wwwroot\ccenter\bin\online.sh"
26.10.2018  18:16               431 online.sh

$ cygpath -u \\192.168.1.5\wwwroot\ccenter\bin\online.sh
//192.168.1.5/wwwroot/ccenter/bin/online.sh

$ cygpath -u "\\192.168.1.5\wwwroot\ccenter\bin\online.sh"
/192.168.1.5/wwwroot/ccenter/bin/online.sh

$ cygpath -u \\HOSTING64.DARKDRAGON.LAN\wwwroot\ccenter\bin\online.sh
//HOSTING64.DARKDRAGON.LAN/wwwroot/ccenter/bin/online.sh

$ cygpath -u "\\HOSTING64.DARKDRAGON.LAN\wwwroot\ccenter\bin\online.sh"
//HOSTING64.DARKDRAGON.LAN/wwwroot/ccenter/bin/online.sh

$


-- 
With best regards,
Andrey Repin
Wednesday, April 3, 2019 19:11:14

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] 6+ messages in thread

* Re: cygpath -u converts quoted UNC paths to local
  2019-04-03 16:20 cygpath -u converts quoted UNC paths to local Andrey Repin
@ 2019-04-03 16:31 ` Corinna Vinschen
  2019-04-04  7:50   ` Andrey Repin
  2019-04-03 17:11 ` Achim Gratz
  2019-04-03 17:49 ` Chris Wagner
  2 siblings, 1 reply; 6+ messages in thread
From: Corinna Vinschen @ 2019-04-03 16:31 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 828 bytes --]

On Apr  3 19:20, Andrey Repin wrote:
> Greetings, All!
> 
> This can be considered "working by design", but it really imposes some serious
> restrictions on interoperability with Cygwin, that I think can be avoided.
> 
> ...
> 
> After some further testing, this seems to be affecting IP-based UNC paths
> only.
> 
> The essence is this:
> 
> $ dir "\\192.168.1.5\wwwroot\ccenter\bin\online.sh"
> 26.10.2018  18:16               431 online.sh
> 
> $ cygpath -u \\192.168.1.5\wwwroot\ccenter\bin\online.sh
> //192.168.1.5/wwwroot/ccenter/bin/online.sh
> 
> $ cygpath -u "\\192.168.1.5\wwwroot\ccenter\bin\online.sh"
> /192.168.1.5/wwwroot/ccenter/bin/online.sh

This shows that it's not cygpath.  It's the quoting, thus the shell
mangles the path.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: cygpath -u converts quoted UNC paths to local
  2019-04-03 16:20 cygpath -u converts quoted UNC paths to local Andrey Repin
  2019-04-03 16:31 ` Corinna Vinschen
@ 2019-04-03 17:11 ` Achim Gratz
  2019-04-03 17:42   ` EXT: " Garber, Dave (BHGE, Non-GE)
  2019-04-03 17:49 ` Chris Wagner
  2 siblings, 1 reply; 6+ messages in thread
From: Achim Gratz @ 2019-04-03 17:11 UTC (permalink / raw)
  To: cygwin

Andrey Repin writes:
> This can be considered "working by design", but it really imposes some serious
> restrictions on interoperability with Cygwin, that I think can be avoided.

But cygpath never sees the quotes, so whatever is done to the path that
it gets is actually the work of your shell.  In other words, you need to
shell-quote the backslashes as appropriate for your shell.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

DIY Stuff:
http://Synth.Stromeko.net/DIY.html

--
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] 6+ messages in thread

* RE: EXT: Re: cygpath -u converts quoted UNC paths to local
  2019-04-03 17:11 ` Achim Gratz
@ 2019-04-03 17:42   ` Garber, Dave (BHGE, Non-GE)
  0 siblings, 0 replies; 6+ messages in thread
From: Garber, Dave (BHGE, Non-GE) @ 2019-04-03 17:42 UTC (permalink / raw)
  To: Achim Gratz, cygwin

Not completely the shell.

From a Windows command prompt:
c:\Apps\cygwin64\bin\cygpath.exe  -u \\123.456.789.321\wwwroot\ccenter\bin\online.sh
//123.456.789.321/wwwroot/ccenter/bin/online.sh

c:\Apps\cygwin64\bin\cygpath.exe  -u "\\123.456.789.321\wwwroot\ccenter\bin\online.sh"
/cygdrive/c/123.456.789.321/wwwroot/ccenter/bin/online.sh

c:\Apps\cygwin64\bin\cygpath.exe  -u "\\\123.456.789.321\wwwroot\ccenter\bin\online.sh"
//123.456.789.321/wwwroot/ccenter/bin/online.sh

c:\Apps\cygwin64\bin\cygpath.exe  -u "\\\\123.456.789.321\wwwroot\ccenter\bin\online.sh"
//123.456.789.321/wwwroot/ccenter/bin/online.sh

Looks like cygpath is doing something different when the argument is enclosed in quotes (same behavior if single-quote ' is used).
 
> -----Original Message-----
> From: cygwin-owner@cygwin.com <cygwin-owner@cygwin.com> On Behalf
> Of Achim Gratz
> Sent: Wednesday, April 03, 2019 1:12 PM
> To: cygwin@cygwin.com
> Subject: EXT: Re: cygpath -u converts quoted UNC paths to local
> 
> Andrey Repin writes:
> > This can be considered "working by design", but it really imposes some
> > serious restrictions on interoperability with Cygwin, that I think can be
> avoided.
> 
> But cygpath never sees the quotes, so whatever is done to the path that it
> gets is actually the work of your shell.  In other words, you need to shell-
> quote the backslashes as appropriate for your shell.
> 
> 
> Regards,
> Achim.
> --
> +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk
> Blofeld]>+
> 
> DIY Stuff:
> http://Synth.Stromeko.net/DIY.html
> 
> --
> 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


--
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] 6+ messages in thread

* Re: cygpath -u converts quoted UNC paths to local
  2019-04-03 16:20 cygpath -u converts quoted UNC paths to local Andrey Repin
  2019-04-03 16:31 ` Corinna Vinschen
  2019-04-03 17:11 ` Achim Gratz
@ 2019-04-03 17:49 ` Chris Wagner
  2 siblings, 0 replies; 6+ messages in thread
From: Chris Wagner @ 2019-04-03 17:49 UTC (permalink / raw)
  To: cygwin; +Cc: Andrey Repin

On 2019-04-03 12:20 pm, Andrey Repin wrote:
> Greetings, All!
> 
> This can be considered "working by design", but it really imposes some 
> serious
> restrictions on interoperability with Cygwin, that I think can be 
> avoided.
> 
> ...
> 
> After some further testing, this seems to be affecting IP-based UNC 
> paths
> only.
> 
> The essence is this:
> 
> $ dir "\\192.168.1.5\wwwroot\ccenter\bin\online.sh"
> 26.10.2018  18:16               431 online.sh
> 
> $ cygpath -u \\192.168.1.5\wwwroot\ccenter\bin\online.sh
> //192.168.1.5/wwwroot/ccenter/bin/online.sh
> 
> $ cygpath -u "\\192.168.1.5\wwwroot\ccenter\bin\online.sh"
> /192.168.1.5/wwwroot/ccenter/bin/online.sh
> 
> $ cygpath -u \\HOSTING64.DARKDRAGON.LAN\wwwroot\ccenter\bin\online.sh
> //HOSTING64.DARKDRAGON.LAN/wwwroot/ccenter/bin/online.sh
> 
> $ cygpath -u "\\HOSTING64.DARKDRAGON.LAN\wwwroot\ccenter\bin\online.sh"
> //HOSTING64.DARKDRAGON.LAN/wwwroot/ccenter/bin/online.sh
> 
> $


Using echo is a good way of checking just what the shell is handing to 
your program.  But I totally agree that this is a major interoperability 
annoyance.

I'm using Bash 4.4.12(3):

$ echo \\192.168.1.5\wwwroot\ccenter\bin\online.sh
\192.168.1.5wwwrootccenterbinonline.sh

$ echo "\\192.168.1.5\wwwroot\ccenter\bin\online.sh"
\192.168.1.5\wwwroot\ccenter\bin\online.sh

$ echo '\\192.168.1.5\wwwroot\ccenter\bin\online.sh'
\\192.168.1.5\wwwroot\ccenter\bin\online.sh

$ echo \\foo\wwwroot\ccenter\bin\online.sh
\foowwwrootccenterbinonline.sh

$ echo "\\foo\wwwroot\ccenter\bin\online.sh"
\foo\wwwroot\ccenter\bin\online.sh

$ echo '\\foo\wwwroot\ccenter\bin\online.sh'
\\foo\wwwroot\ccenter\bin\online.sh


read -r is an alternate way of getting text into a command line that 
might otherwise turn into quoting hell.

$ read -r; cygpath -u $REPLY
\\192.168.1.5\wwwroot\ccenter\bin\online.sh
//192.168.1.5/wwwroot/ccenter/bin/online.sh









--
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] 6+ messages in thread

* Re: cygpath -u converts quoted UNC paths to local
  2019-04-03 16:31 ` Corinna Vinschen
@ 2019-04-04  7:50   ` Andrey Repin
  0 siblings, 0 replies; 6+ messages in thread
From: Andrey Repin @ 2019-04-04  7:50 UTC (permalink / raw)
  To: Corinna Vinschen, cygwin

Greetings, Corinna Vinschen!

> On Apr  3 19:20, Andrey Repin wrote:
>> Greetings, All!
>> 
>> This can be considered "working by design", but it really imposes some serious
>> restrictions on interoperability with Cygwin, that I think can be avoided.
>> 
>> ...
>> 
>> After some further testing, this seems to be affecting IP-based UNC paths
>> only.
>> 
>> The essence is this:
>> 
>> $ dir "\\192.168.1.5\wwwroot\ccenter\bin\online.sh"
>> 26.10.2018  18:16               431 online.sh
>> 
>> $ cygpath -u \\192.168.1.5\wwwroot\ccenter\bin\online.sh
>> //192.168.1.5/wwwroot/ccenter/bin/online.sh
>> 
>> $ cygpath -u "\\192.168.1.5\wwwroot\ccenter\bin\online.sh"
>> /192.168.1.5/wwwroot/ccenter/bin/online.sh

> This shows that it's not cygpath.  It's the quoting, thus the shell
> mangles the path.

Oh, sorry, stupid habit of mine.
Yes, in Windows convention, shell (CMD) does not perform unquoting.
This makes it impossible to reliable pass parameters to cygpath.


-- 
With best regards,
Andrey Repin
Thursday, April 4, 2019 10:48:12

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] 6+ messages in thread

end of thread, other threads:[~2019-04-04  7:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-03 16:20 cygpath -u converts quoted UNC paths to local Andrey Repin
2019-04-03 16:31 ` Corinna Vinschen
2019-04-04  7:50   ` Andrey Repin
2019-04-03 17:11 ` Achim Gratz
2019-04-03 17:42   ` EXT: " Garber, Dave (BHGE, Non-GE)
2019-04-03 17:49 ` Chris Wagner

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