Re: Accessing web with a C program
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Thu, 15 Feb 2007 12:43:52 -0800
richard@xxxxxxxxxxxxxxx (Richard Tobin) writes:
In article <45d46812.180010404@xxxxxxxxxxxxxx>,
Richard Bos <rlb@xxxxxxxxxxxxxxxxxxxxxx> wrote:
Again: it is not fopen() which supports this in the first place. fopen()
gives you what it gets from the OS. To suggest that the C library
_should_ bypass the OS and support HTTP (how!?) when the OS only gives
you NFS as normal files is, IMO, rather weird.
It would be bizarre for the OS (in the sense of the unix kernel) to
provide support for arbitrary protocols such as HTTP, since there's no
need for them to be implemented at that level. It would not make much
sense for it to be part of C either. But it would be perfectly
reasonable for a library to provide it, and for it to use the fopen()
function to do it. Obviously it would need various support functions,
because these protocols have many options that can't reasonably be
accessed through standard C functions, but it would be very useful if
existing programs that fopen() a file for reading were to suddenly
start working with, say, HTTP URIs.
Probably the most reasonable way to do this, on most systems, is to
provide a filesystem that's actually implemented on top of an http
interface, mapping URLs to file names somehow (the mapping could be
trivial or not). Some systems already provide hooks to support this
kind of thing. The details of implementing this kind of thing are, of
course, off-topic, but no more so than implementing a filesystem that
provides access to a local hard drive. Once it's done, fopen() and
friends will Just Work.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.
- Follow-Ups:
- Re: Accessing web with a C program
- From: CBFalconer
- Re: Accessing web with a C program
- References:
- Accessing web with a C program
- From: Neo
- Re: Accessing web with a C program
- From: Richard Bos
- Re: Accessing web with a C program
- From: Keith Thompson
- Re: Accessing web with a C program
- From: Richard Bos
- Re: Accessing web with a C program
- From: Richard Tobin
- Accessing web with a C program
- Prev by Date: Re: full in the blank , making use of a[10] to outputcontent of i
- Next by Date: function system() from stdlib.h
- Previous by thread: Re: Accessing web with a C program
- Next by thread: Re: Accessing web with a C program
- Index(es):
Relevant Pages
|