public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: UNC path syntax
@ 1997-04-04 16:48 Mikey
  0 siblings, 0 replies; 5+ messages in thread
From: Mikey @ 1997-04-04 16:48 UTC (permalink / raw)
  To: Jim Balter; +Cc: cygnus

I hate to be the bad news man, but this patch really messes up find.exe,
Sorry ;^).

> *** path.cc.orig	Sun Mar 23 02:15:12 1997
> --- path.cc	Sun Mar 23 03:15:33 1997
> ***************
> *** 208,214 ****
>   
>     /* The rule is :'s can't appear in [our] posix path names so this is
a safe
>        test; if ':' is present it already be in win32 form.  */
> !   if (strchr (src_path, ':') != NULL)
>       {
>         debug_printf ("conv_to_win32_path: %s already win32\n",
src_path);
>         if (win32_path != NULL)
> --- 208,216 ----
>   
>     /* The rule is :'s can't appear in [our] posix path names so this is
a safe
>        test; if ':' is present it already be in win32 form.  */
> !   // JQB: hack in test for \\ as well
> !   if (strchr (src_path, ':') != NULL ||
> !       src_path[0] == '\\' && src_path[1] == '\\')
>       {
>         debug_printf ("conv_to_win32_path: %s already win32\n",
src_path);
>         if (win32_path != NULL)
> ***************
> *** 305,313 ****
>   	{
>   	  int j = mount[i].devicelen;
>   	  memcpy (p, mount[i].device, j);
> ! 	  if (pathbuf[mount[i].pathlen] != '/')
>   	    p[j++] = '\\';
> ! 	  strcpy (p + j, pathbuf + mount[i].pathlen);
>   	  backslashify (p, p, trailing_slash_p);
>   	}
>         if (win32_path != NULL && ! got_rel_p && win32_path != p)
> --- 307,321 ----
>   	{
>   	  int j = mount[i].devicelen;
>   	  memcpy (p, mount[i].device, j);
> ! 
> ! 	  // JQB: add test for empty tail, so, for instance,
> ! 	  // \\.\tape0 doesn't turn into \\.\tape0\,
> ! 	  // which win32 doesn't like.  Still turn a: into a:\ though.
> ! 	  char *tail = pathbuf + mount[i].pathlen;
> ! 	  if ((*tail || tail[-1] == ':') && *tail != '/')
>   	    p[j++] = '\\';
> ! 	  strcpy (p + j, tail);
> ! 
>   	  backslashify (p, p, trailing_slash_p);
>   	}
>         if (win32_path != NULL && ! got_rel_p && win32_path != p)
> 
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

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

* Re: UNC path syntax
  1997-04-01 10:31 ` Ed Huott
@ 1997-04-02  0:37   ` Jim Balter
  1997-04-01 23:23     ` Ed Huott
  0 siblings, 1 reply; 5+ messages in thread
From: Jim Balter @ 1997-04-02  0:37 UTC (permalink / raw)
  To: Ed Huott; +Cc: Tom Yonkman, gnu-win32

Ed Huott wrote:
> 
> In message <34035660.1323@elementalsoftware.com>, Tom Yonkman writes:
> >     Just started using the gnu-win32 package and wonder if ls and friends
> >     can handle the UNC path syntax in some way? This would allow access to
> >     machines in my "Network Neighborhood", as the explorer so quaintly
> >     puts it.
> >
> 
> No.  Nothing built with cygwin32 can deal with UNC path names.  The
> cygwin32 approach requires that you map a drive to any remote (network
> neighborhood) volumes.  Inside the bash shell, a mapped network drive
> such as N: can then be referenced using the path "//N".  This syntax
> can, unfortunately, collide with the most logical choice for
> referencing a network share, which would be something like:
> "//ComputerName/SharedDrive".
> 
> There is a unix-like volume mounting scheme that lets you acces a
> drive as a sub-directory (i.e. N: ==> /DriveN) something like the old
> DOS "join" command, but this works *only* for apps built with
> cygwin32.
> 
> Lack of UNC support can be a real drawback if you're dealing in an
> environment that uses a mix of both native (Windows) and cygwin32
> apps.

You can refer to UNC paths with, e.g., "\\xxx\y", but not
"//xxx/y", which gets turned into "c:\xxx\y".  You can use names like
"\\.\a:", but not "\\.\tape0", which gets turned into "c:\tape0".
And you cannot use UNCs in mounts; they get a \ appended that win32
can't handle.  I've attached a patch that fixes the latter two.
Among other things, this will allow you to read a local tape drive
on WinNT via tar, dd, etc. by using /dev/st0 if you fix the bogus mount
table entries (the proper name is "\\.\tape0", not "\\.\tape0:"):

umount /dev/st0
mount '\\.\tape0' /dev/st0
umount /dev/st1
mount '\\.\tape1' /dev/st1

Due to other bugs, this still does not allow you to write to local tape
via cygwin, however.

--
<J Q B>

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

* Re: UNC path syntax
  1997-04-02  0:37   ` Jim Balter
@ 1997-04-01 23:23     ` Ed Huott
  0 siblings, 0 replies; 5+ messages in thread
From: Ed Huott @ 1997-04-01 23:23 UTC (permalink / raw)
  To: Jim Balter; +Cc: Tom Yonkman, gnu-win32

In message < 3341A74E.627F@netcom.com >, Jim Balter writes:
>You can refer to UNC paths with, e.g., "\\xxx\y", but not
>"//xxx/y", which gets turned into "c:\xxx\y".  You can use names like

Are you sure about this?  With my (unpatched) copy of b17.1 running on
NT 3.51 or NT 4.0, cygwin's `ls' command fails when I use this syntax.
E.g.:

  C:\>ls \\newt\c
  ls: \\newt\c: No such file or directory

where "\\newt\c" is a valid share name on my network (i.e. I can do
`dir \\newt\c' and it works).

BTW, the behavior of `ls' invoked under bash is the same (with all \'s
properly escaped or quoted, of course! :-).  Please let me know if
there's something I'm missing here.

<ED>
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

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

* Re: UNC path syntax
  1997-03-31 14:04 Tom Yonkman
@ 1997-04-01 10:31 ` Ed Huott
  1997-04-02  0:37   ` Jim Balter
  0 siblings, 1 reply; 5+ messages in thread
From: Ed Huott @ 1997-04-01 10:31 UTC (permalink / raw)
  To: Tom Yonkman; +Cc: gnu-win32

In message <34035660.1323@elementalsoftware.com>, Tom Yonkman writes:
>     Just started using the gnu-win32 package and wonder if ls and friends 
>     can handle the UNC path syntax in some way? This would allow access to 
>     machines in my "Network Neighborhood", as the explorer so quaintly 
>     puts it.
>     

No.  Nothing built with cygwin32 can deal with UNC path names.  The
cygwin32 approach requires that you map a drive to any remote (network
neighborhood) volumes.  Inside the bash shell, a mapped network drive
such as N: can then be referenced using the path "//N".  This syntax
can, unfortunately, collide with the most logical choice for
referencing a network share, which would be something like:
"//ComputerName/SharedDrive".

There is a unix-like volume mounting scheme that lets you acces a
drive as a sub-directory (i.e. N: ==> /DriveN) something like the old
DOS "join" command, but this works *only* for apps built with
cygwin32.

Lack of UNC support can be a real drawback if you're dealing in an
environment that uses a mix of both native (Windows) and cygwin32
apps.

<ED>
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

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

* UNC path syntax
@ 1997-03-31 14:04 Tom Yonkman
  1997-04-01 10:31 ` Ed Huott
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Yonkman @ 1997-03-31 14:04 UTC (permalink / raw)
  To: gnu-win32

     Just started using the gnu-win32 package and wonder if ls and friends 
     can handle the UNC path syntax in some way? This would allow access to 
     machines in my "Network Neighborhood", as the explorer so quaintly 
     puts it.
     
     aTdHvAaNnKcSe,
     
     - ty -
     
     ******************************************************************
     * Tom Yonkman              email: tyonkman@elementalsoftware.com *
     * Elemental Software, Inc. phone: 760.931.7171 x3143             *
     * 5927 Priestly Drive      url: http://www.elementalsoftware.com *
     * Carlsbad, CA 92008       email2: tyonkman@cts.com              *
     ******************************************************************

-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

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

end of thread, other threads:[~1997-04-04 16:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-04-04 16:48 UNC path syntax Mikey
  -- strict thread matches above, loose matches on Subject: below --
1997-03-31 14:04 Tom Yonkman
1997-04-01 10:31 ` Ed Huott
1997-04-02  0:37   ` Jim Balter
1997-04-01 23:23     ` Ed Huott

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