Re: URIs vs. half-baked URIs [glib PATCH]



On 24Aug2001 12:05PM (-0400), Alex Larsson wrote:
> On Fri, 24 Aug 2001, Darin Adler wrote:
> 
> > On Friday, August 3, 2001, at 05:57  PM, Alex Larsson wrote:
> > 
> > > +    uri = g_strconcat ("file://", utf8_filename, NULL);
> > 
> > Is it better to use file:///etc rather than file:/etc (you have to chose 
> > one as the canonical form when writing a function like this)?
> >
> > We did that in Nautilus and gnome-vfs, but I don't know why. If we make 
> > the change to use the shorter version as the canonical form, we must be 
> > careful to handle the hostname == "" case the same as the hostname == NULL 
> > case.
> 
> I copied the current behaviour from gnome-vfs. Konqueror gives URIs like 
> "file:/home/devel/alexl/all_types.c", maybe we should too.
> 
> In fact, I think I'll change it. (Unless people have strong opinions on 
> this.)

The URI RFC (2396) says both forms are OK, so it's probably better to
go with the simpler one. On the other hand, it's good to have code
agree on what the canonical form is, so other code in gnome-vfs and
nautilus that deals with canonical forms might have to special-case
`file:' since you can't leave out the `//' for http: or ftp:, even
when the host is `localhost'. I'd be a lot happier if you made that
change throughout if you do it this way.

 - Maciej




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]