cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: "No such file or directory" error and local empty file.

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Tue, 4 May 2004 12:58:58 +0200 (CEST)

On Tue, 4 May 2004, Alexander Krasnostavsky wrote:

> > So, when do you create the local file?

> I am not creating the file. The file created when "curl_easy_perform()"
> function executed. This is libcurl functionality.

Look again. libcurl doesn't create any files. If you download data it defaults
to sending it to stdout.

You can change that by setting CURLOPT_WRITEDATA to a FILE * to use instead. I
bet you created a file when when use fopen() to get a FILE *.

To avoid this problem, don't open the file until your write callback is called
the first time. If you don't want your own callback I don't think you can
avoid this problem.

-- 
     Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
      Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-05-04