[whatwg] URL: file: URLs

Mikko Rantalainen mikko.rantalainen at peda.net
Wed Oct 31 01:27:10 PDT 2012


João Eiras, 2012-10-31 01:41 (Europe/Helsinki):
> In both Firefox and Chrome if you type file://aaa/some/path, or
> file://localhost/some/path, the aaa and localhost parts are ignored, and
> the rest of the path is interpreted as a local file path. In Opera,
> anything that is not localhost gives an error.

How about following:

(1) file://c:/foo tries to connect to server "c:" and request shared
entity "foo".

(2) file://foo/bar tries to connect to server "foo" and request shared
entity "bar"

(3) file:///c:/foo tries to refer to localhost path /c:/foo which in
windows environment would be interpreted as local C:\foo,
POSIX-compatible systems would try literal /c:/foo (colon is a valid
character in the path name).

(4) file://localhost/c:/foo is identical to (3) above.

I understand that (1) would behave different from some legacy user
agents but there really is not interoperability with such file URLs so I
guess that does not matter too much.

Some legacy user agents also support URLs such as

(5) file:///c|/foo which is considered equal to (3). I have no idea why
the pipe is considered better character than colon here.

Some problematic URLs are still possible:

(6) file:///foo/bar should refer to entity "/foo/bar" in
POSIX-compatible systems but I have no idea where it would map to with
windows-style drive letter naming at the start of the local path.

-- 
Mikko




More information about the whatwg mailing list