gnustep-dev
[Top][All Lists]
Advanced

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

Re: NSURL path question


From: Richard Frith-Macdonald
Subject: Re: NSURL path question
Date: Fri, 6 Feb 2004 18:22:23 +0000


On 6 Feb 2004, at 16:55, Stefan Urbanek wrote:

Hi,

I would like to ask about NSURL path. I'll be more concrete, so here is example in StepTalk script. Consider two paths:

    url_slash := NSURL URLWithString:'http://www.gnustep.org/'.
    url_no_slash := NSURL URLWithString:'http://www.gnustep.org'.

then try to fetch contents of those URLs:

    string_ok := NSString stringWithContentsOfURL:url_slash.
    string_broken := NSString stringWithContentsOfURL:url_noslash.

The string_ok is loaded as it should. While loading the string_broken I get:

2004-02-06 17:44:16.300 stexec[483] File NSString.m: 1708. In [GSPlaceholderString -initWithContentsOfURL:] Contents of URL 'http://www.gnustep.org' are not readable

What is the problem?
... path should be default '/' in NSURL?

No ... because MacOS-X doesnt do that.

... i should allways check whether path in the url is '/', so if there is no path, I should add it there?

No ... the library should make things easy for you.

... there is something wrong with NSURL handle for HTTP protocol?

Yes ... NSURLHandle for the HTTP protocol should use '/' if there is no path provided.

I've committed a fix to CVS.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]