proposal for file: uri standard

Alexander Larsson alexl at
Mon Mar 29 15:35:33 EEST 2004

On Mon, 2004-03-29 at 14:16, Waldo Bastian wrote:
> Hash: SHA1
> On Mon March 29 2004 13:03, Alexander Larsson wrote:
> > Here is some stuff I wrote down in order to standardized the use of
> > file: uris as used on the desktop. Most of it actually follows from the
> > various standards involved, so it should not be contentious, but its
> > good to have it written down plainly.
> >
> > Opinions?
> I'm ok with the general direction.


> > Given a URI like this we can unescape it into a hostname, and a string
> > of octets (of undefined encoding), which we wish to map to a UNIX
> > filename.
> Suggest: "which maps 1:1 to a UNIX filename"

Sounds good.

> > Backwards compatibility:
> > ------------------------
> >
> > Some current apps generate URIs of the form "file:/<path>". These
> > are not correct according to RFC1738, so they should not be
> > generated. However, its recommended that code correctly handle such
> > URIs as input.
> Suggest: "it is recommended that such URIs are interpreted as file URIs with 
> an empty hostname."


> Apart from that I have the suspicion that the hostname part is 
> under-specified. E.g. what does an empty hostname mean, should "localhost" be 
> handled differently, should the hostname be a FQDN?


I'm not actually aware of any app that uses the hostname part, but the
XDnD spec says its an error to not pass it [1]. The most basic use of
the hostname would be to check if it was the same as the current
machine, to do that it would be nice if the hostname was of some
canonical form, and its evident that localhost and empty hostname needs
to be handled specially (not with a strcmp).

The more advanced use of hostnames would be to convert e.g.
file://hostname/some/file to e.g. sftp://user@hostname/some/files for
non-local files (user comes from text/x-xdnd-username in the dnd
data[1]). However, such use sounds a bit far fetched to me. But maybe
someone would find that useful? Anyway, in this case you'd need the
hostname to be good enough to resolve from the DnD target machine, which
sort of implies a FQDN.


 Alexander Larsson                                            Red Hat, Inc 
                   alexl at    alla at 
He's a witless day-dreaming barbarian in a wheelchair. She's a plucky bisexual 
archaeologist with her own daytime radio talk show. They fight crime! 

More information about the xdg mailing list