xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas B. Passin" <tpas...@mitretek.org>
Subject Re: XML help needed
Date Tue, 14 Aug 2001 20:12:03 GMT
[Edwin Goei]

> Shane Curcuru wrote:
> >
> > Brief rules:
> > -- the file: scheme, when referring to a file on the local machine
> > (i.e. you don't really care about the host) will always start with
> > "file:///", and then with an absolute path as defined by the local
> > environment.  I'm trying to figure out what this means for UNIX
> > systems, which would seem to have abs paths of "/usr/foo", which means
> > a URL thereon would be "file:////usr/foo", which seems to choke a lot
> > of programs.
> Hmmm, 4 slashes... I would expect that for unix systems, where there is
> no drive letter, a file "/usr/foo" would be referred to as
> "file:///usr/foo".  Three (3) slashes, instead of 4.

This can be a very tricky subject since there are ambiguities in the rfc.
But four slashes are not the way.  The scheme is denoted by "file:"  .  Then
comes the server, denoted by "//servername".  Then comes the root path,
which is a single slash in unix, followed by the rest of the path.

Three slashes in a row mean a blank server name.  This is taken to mean
"localhost", so these two are supposed to indicate the same thing:

1) file:///
2) file://localhost/

You never need a fourth slash because the third already indicates the root.

There's no problem or ambiguity for a unix system, but on windows you have
two problems:  do you use forward or backslashes, and what to use for the
root of the file system.  Is it "d:" or /"d:"?

Often a program will accept a file: url without the two leading slashes (or
even without all three)and treat it just like "file:///", although strictly
speaking this isn't correct.

Any other behavior is either an error or an attempt to make the code more
error-tolerant by handling common (mistaken) usages.


Tom P

In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org

View raw message