cURL / Mailing Lists / curl-library / Single Mail


Re: CURLOPT_WRITEDATA append vs overwrite

From: Dan Fandrich <>
Date: Thu, 5 Jun 2008 15:02:24 -0700

On Thu, Jun 05, 2008 at 01:54:39PM -0700, Ganesh Ragavan wrote:
> I do pass in a valid file descriptor with CURLOPT_WRITEDATA and I fopen the
> file with 'w' mode that erases the contents, but this happens outside the retry
> loop.
> So if curl_easy_perform(curl_desc) fails and before curl_easy_perform
> (curl_desc) is called again in the retry loop,
> can I do a seek of the file descriptor to point it back to the start of the
> file ?

That should be fine, as long as there is no danger of the size of the file
changing between invocations. You could end up with garbage at the end
of the file in that case.

>>> Dan

--              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-06-06