W3C home > Mailing lists > Public > www-lib@w3.org > April to June 1999

Re: Reading from a local file

From: Henrik Frystyk Nielsen <frystyk@w3.org>
Date: Tue, 18 May 1999 17:48:47 -0400
To: www-lib@w3.org
Message-ID: <3741E03F.E6E9397B@w3.org>
To: Allen Comer <comer@entropic.com>
Allen Comer wrote:
> Hi,
> I'm a newcomer so I apologize in advance if any of this has been covered
> previously.  I did search through the archives but couldn't find anything.
> I have two questions:
> * I'm trying to read from a local file.  I'm using the following sequence
> (with some obvious things omitted):
>         request = HTRequest_new();
>         anchor = HTAnchor_findAddress(uri);
>       status = HTLoadAnchor(anchor, request);
>         status = HTLoadFile(sock, request);
> My question is what is the meaning of 'sock' within the context of local
> file access?  how should I be initializing this parameter?

Try and use some of the sample applications at


linked from


For this particular sample app you must use a file: URI - it can't jsut
be a file name. The command line tool handles relative file names as
> * Secondly, is it always necessary, or advantageous, to use 'HTAnchor'
> objects?

Anchor objects are neat when you want to know (and remember) things
about URIs and the contents behind them.

Henrik Frystyk Nielsen, <frystyk@w3.org>
World Wide Web Consortium, MIT/LCS NE43-356
545 Technology Square, Cambridge MA 02139, USA
Received on Tuesday, 18 May 1999 17:48:52 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:33:49 UTC