cURL / Mailing Lists / curl-library / Single Mail

curl-library

fopen() emulation

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 3 May 2002 16:45:43 +0200 (MET DST)

Hey

Sometimes I get questions from people how to fetch URLs in a fashion similar
to how fopen()/fread()/fclose() work.

Using the libcurl multi interface, this is already possible to do. I attach a
simple "proof of concept" code snippet attached to this mail. The actual URL
reading is made with the url_fopen(), url_fread() and url_fclose() functions
that are all included.

For use in real-world applications, this would need some more error checks
and possibly some adjustments, but this serves as showing that this is
certainly possible.

(You might need very recent CVS sources for the multi interface to work
properly.)

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth_at_sourceforge.net

Received on 2002-05-03