Re: Accessing web with a C program
- From: Christopher Layne <clayne@xxxxxxxxxxxx>
- Date: Fri, 16 Feb 2007 05:57:26 -0800
Richard Tobin wrote:
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.
-- Richard
If you think about it - and we were all using URIs diligently, it wouldn't be
that bizarre of an idea.
Environments like KDE do this at a higher level allowing you to specify any
kind of URI as an argument to a file open, save, etc.
However, being that fopen only takes two arguments, it'd be really difficult
to make fly with the OS handling the underlying details. A complex protocol
like http has so many options (just look at libcurl) that you'd have to pass
a structure as the second argument.
The actual mapping of binary data received over a network connection specified
somehow via a URI of sort wouldn't be the difficult part.
.
- Follow-Ups:
- Re: Accessing web with a C program
- From: Richard Tobin
- Re: Accessing web with a C program
- From: Christopher Layne
- 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: May output the char one after one every other second?
- Next by Date: Re: Accessing web with a C program
- Previous by thread: Re: Accessing web with a C program
- Next by thread: Re: Accessing web with a C program
- Index(es):
Relevant Pages
|