cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: can curl output to a string?

From: Eduardo Reis <eduardo_reis_at_compuquali.com>
Date: Tue, 14 Nov 2000 18:41:22 -0000

And in C can I put curl's output in a string? Or I need to write it always
to file?

Eduardo

---
Compuquali. SA - GFI Group
E-mail: eduardo_reis_at_compuquali.com
Telef: +351-229417877
Telem: +351-919556791
"Yes means No and No means Yes. Delete all files [Y]? "
----- Original Message -----
From: "Daniel Stenberg" <daniel_at_haxx.se>
To: "Curl Mailinglist" <curl_at_contactor.se>
Sent: Tuesday, November 14, 2000 4:11 PM
Subject: Re: can curl output to a string?
> On 14 Nov 2000, Miguel Mendes wrote:
>
> > I'm doing some web fetching, something like this:
> >
> > $url = "http://www.some-site.com/index.html"
> >
> > $ch = curl_init ($url);
> > $fp = fopen ($url, "w");
> >
> > curl_setopt ($ch, CURLOPT_FILE, $fp);
> >
> > curl_exec ($ch);
> > curl_close ($ch);
> > fclose ($fp);
>
> This is obviously the curl module for PHP4 you're talking about.
>
> Sterling Hughes of the PHP team is the one who's written that module if
I'm
> not mistaking.
>
> I've never even used it.
>
> > Is there a way to output the fetched page directly to a string, avoiding
> > writing to a file?
>
> The curl module for PHP has a glue layer between PHP and libcurl. It could
> indeed be written to collect all contents into a "string". This isn't
really
> a limitation in curl (even though libcurl's design limits some things).
This
> is merely a design choice of that module.
>
> I'm sorry, but this suggestion should probably be sent to the curl module
> author.
>
> --
>   Daniel Stenberg -- curl project maintainer -- http://curl.haxx.se/
Received on 2000-11-14