Re: Accessing web with a C program



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.
.



Relevant Pages

  • Re: Accessing web with a C program
    ... richard@xxxxxxxxxxxxxxx (Richard Tobin) writes: ... _should_ bypass the OS and support HTTP when the OS only gives ... mapping URLs to file names somehow (the mapping could be ...
    (comp.lang.c)
  • Re: how to publish an XBAP through IIS 7
    ... HTTP Error 404. ... Let's use webfetch to trace the rawdata of http request/response and check ... Microsoft Online Community Support ... initial response from the community or a Microsoft Support Engineer within ...
    (microsoft.public.inetserver.iis.ftp)
  • RE: Writing A Web Browser.... Sort of...
    ... in ASP.NET which is still able to used in SPS server: ... Introduction to HTTP Modules ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Shared drives through a firewall
    ... Webdav allows access either via a webdav client that supports writing or a standard http client. ... It has good application layer support from a wide variety of reverse proxy/firewall products designed for protecting web traffic if you choose to expose it externally. ... It's also fairly difficult to distinguish from a regular webserver, so it's far less likely to draw attention from attackers than opening up SMB ports, particularly if you had a webserver running anyway. ...
    (Focus-Microsoft)
  • Re: Generated javascript from .pl files
    ... Because web servers might use a different HTTP specification than ... the visiting browser, so possible HTTP version conflicts arise. ... I'd like to see an otherwise usable Web client that does not support ... one that is used here does not rely on the (Content-* request) HTTP headers. ...
    (comp.lang.javascript)