RE: representing UNC as a URI

Hi,

I'd suggest you look at the SMB File Sharing URI Scheme:

  ftp://ftp.ietf.org/internet-drafts/draft-crhertel-smb-url-06.txt

which includes the following on page 13:


7. The Relationship Between the SMB URI and the UNC Format

   Some operating systems support a format known as Universal Naming
   Convention (UNC).  UNC is a means for identifying network resources.
   SMB is one of the protocols supported by UNC.

   In general, a UNC string specifying a resource available via SMB
   protocol can be converted into an SMB URI string by simply adding
   the "smb:" or "cifs:" prefix and reversing the direction of all of
   the separating slashes.  For example:

   UNC form                          URI form
   -------------------------------   -----------------------------------
   \\corgis\docs\                    smb://corgis/docs/
   \\corgis\docs\jolyon\             smb://corgis/docs/jolyon/
   \\corgis\docs\jolyon\rabbit.txt   smb://corgis/docs/jolyon/rabbit.txt

Cheers,
- Ira

Ira McDonald (Musician / Software Architect)
Blue Roof Music / High North Inc
PO Box 221  Grand Marais, MI  49839
phone: +1-906-494-2434
email: imcdonald@sharplabs.com

-----Original Message-----
From: Pascal Buhler [mailto:pbuhler@trolltech.com]
Sent: Tuesday, May 11, 2004 5:13 AM
To: uri@w3.org
Subject: representing UNC as a URI



Hi,

I am trying to find the best way to represent a windows
share UNC as a file:// URI  and am not having much luck
finding a definite example on the net so I hope here is a
good place to ask.

If I have a windows share called //myshare/mydir

then in windows explorer typing both of these in to the
address bar resolves to the correct location

file:////myshare/mydir
file://myshare/mydir

but the path segment of these is different and the
file://myshare/mydir is only valid with regard to computers
that are in the same windows domain.

also if I use  file:////myshare/mydir then the current rfc
tells me that if there is no authority then //authority can
be removed with would leave with  file://myshare/mydir witch
is not the same URI.

Also the ABNF has the rule
path-abs        ; begins with "/" but not "//"
witch I guess should prevent the above from happening.


I am guessing the answer should be that //myshare/mydir
should be considered a path-abempty and so I should use
file:////myshare/mydir and don't remove // empty authority
if the path starts with // when writing out the complete URI

Is this correct?

thanks

pascal

Received on Tuesday, 11 May 2004 11:36:27 UTC