in reply to syntax for URI of files?

URIs and URLs are not quite the same thing. URL is a special kind of URI that specifies a physical server that a document exists on. There are some protocols (such as Freenet (external link)) where a peice of data exists "out there", but you can't pinpoint an exact location. In such a case, you can't use URLs, but URIs work just fine.

Anyways, URI syntax for files is just 'file://' followed by the absolute path to the file. So an example of a Win32 file URI would be 'file://C:\windows'. On *nix, you get a horrid series of toothpicks: 'file:///usr/local' (though I've noticed that KDE assumes the begining slash on the filename, thus allowing 'file://usr/local').

Update: I forgot that ':' has special meaning in a URI. As another poster pointed out, a Win32 file URI should be 'file://C|\windows'.

----
Reinvent a rounder wheel.

Note: All code is untested, unless otherwise stated

Replies are listed 'Best First'.
Re: Re: syntax for URI of files?
by John M. Dlugosz (Monsignor) on Mar 06, 2003 at 16:30 UTC
    Last I read, URL is being dropped from technical documents. At http://www.w3.org/Addressing/ "URL Uniform Resource Locator. An informal term (no longer used in technical specifications) associated with popular URI schemes: http, ftp, mailto, etc." Also http://www.w3.org/Addressing/9710-uri-vs-url.html.

    I find what you mentioned in the 1998 spec, and I guess the "cool URLs don't change!" backlash drove the quest that things on the web be URI's, not something that happens to be the current location but might change.