curl-library
RE: patch to make drive letters work in file:// urls under Window s
Date: Thu, 7 Aug 2003 20:11:35 +0200 (CEST)
On Thu, 7 Aug 2003, David Byron wrote:
> Was sort of waiting for a comment from Daniel about this. Is the test for a
> colon really necessary?
>
> What I don't like about the situation with the patch is that I can't figure
> out how to specify paths from the root of the current drive. Not sure this
> is supposed to be supported, or supported by browsers or what.
>
> For example,
>
> file://localhost/src/blah
>
> is a relative path -- src/blah from the current directory
I don't think this is the case. I think browsers treat this as a relative
directory from the root... which thus is the same as an absolute on.
curl used to support relative file:// urls until it was discovered that other
tools (I believe it was lynx) don't use them that way.
(If I'm not mistaking.)
> What I think I want is for
>
> file://localhost//src/blah
>
> to be /src/blah from the root of the current drive.
>
> Because of the parsing in url.c (I think), the extra slash gets blown away.
>
> I don't think the test for a colon improves this though. It would make both
> of these URLs get interpreted from the root of the current drive.
I think the test for the colon (or pipe) needs to be there so that you can
ignore the initial slash.
You could probably quite easily test these theories by pasting in some
suitable file:// URLs into IE and Mozilla, both running on Windows. curl
should get the same files they do.
-- Daniel Stenberg -- curl: been grokking URLs since 1998 ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01Received on 2003-08-07