AP05/curl_arm64/share/man/man3/CURLOPT_STDERR.3
2025-12-02 13:06:35 +08:00

48 lines
1.3 KiB
Groff

.\" generated by cd2nroff 0.1 from CURLOPT_STDERR.md
.TH CURLOPT_STDERR 3 "2025-07-07" libcurl
.SH NAME
CURLOPT_STDERR \- redirect stderr to another stream
.SH SYNOPSIS
.nf
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_STDERR, FILE *stream);
.fi
.SH DESCRIPTION
Pass a FILE * as parameter. Tell libcurl to use this \fIstream\fP instead of
stderr when showing the progress meter and displaying \fICURLOPT_VERBOSE(3)\fP
data.
If you are using libcurl as a Windows DLL, this option causes an exception and
a crash in the library since it cannot access a FILE * passed on from the
application. A work\-around is to instead use \fICURLOPT_DEBUGFUNCTION(3)\fP.
.SH DEFAULT
stderr
.SH PROTOCOLS
This functionality affects all supported protocols
.SH EXAMPLE
.nf
int main(void)
{
CURL *curl = curl_easy_init();
FILE *filep = fopen("dump", "wb");
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
curl_easy_setopt(curl, CURLOPT_STDERR, filep);
curl_easy_perform(curl);
}
}
.fi
.SH AVAILABILITY
Added in curl 7.1
.SH RETURN VALUE
\fIcurl_easy_setopt(3)\fP returns a CURLcode indicating success or error.
CURLE_OK (0) means everything was OK, non\-zero means an error occurred, see
\fIlibcurl\-errors(3)\fP.
.SH SEE ALSO
.BR CURLOPT_DEBUGFUNCTION (3),
.BR CURLOPT_NOPROGRESS (3),
.BR CURLOPT_VERBOSE (3)