W3C home > Mailing lists > Public > uri@w3.org > October 2004

Re: file: URI scheme

From: Gisle Aas <gisle@ActiveState.com>
Date: 29 Sep 2004 04:13:05 -0700
To: Graham Klyne <GK@ninebynine.org>
Cc: Mike Brown <mike@skew.org>, uri@w3.org
Message-ID: <lrd605qqf2.fsf@caliper.activestate.com>

> > > For MS-Windows
> > > --------------
> > > filename->URI:
> > > If filename starts with x:... (with 'x' a letter), a leading '/' is
> > > added.  Convert all '\' characters to '/'.  Apply URI escaping as needed
> > > (including to any '?' and '#' characters).  The URI is formed by append the
> > > resulting string to file://

With this scheme it would also be helpful to explain how relative URIs
are resolved.  For example from the document file:///c:/xxx.html I
might have links taking me to:

   ../foo.html
   ../../foo.html
   ../c:/foo.html
   ../c|/foo.html     

Are any of these valid references to the "file:///c:/foo.html"
document?

MSIE resolves these as:

   file:///C:/foo.html
   file:///C:/foo.html
   file:///C:/c:/foo.html
   file:///C:/c:/foo.html

FireFox resolves these as:

   file:///foo.html
   file:///foo.html
   file:///c:/foo.html
   file:///c|/foo.html

For the Perl URI module I used to try to map the drive to the
authority component, i.e. c:\foo.html became file://c:/foo.html.  This
made it possible to map absolute and relative file names to URIs and
then use the standard URI rules for resolving absolute names that
ended up consistent with what the OS rules for resolving the
corresponding file names are.  The disk drives are really separate
namespaces (for relative references) and that is basically what the
authority component is supposed to name.

I liked that mapping but apparently nobody else did, so recent
versions of URI.pm has started to produce these tripple slash URLs
instead.

Regards,
Gisle Aas
Received on Friday, 1 October 2004 17:16:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 13 January 2011 12:15:34 GMT