CURLOPT_STDERR.3 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. .\" generated by cd2nroff 0.1 from CURLOPT_STDERR.md
  2. .TH CURLOPT_STDERR 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_STDERR \- redirect stderr to another stream
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_STDERR, FILE *stream);
  9. .fi
  10. .SH DESCRIPTION
  11. Pass a FILE * as parameter. Tell libcurl to use this \fIstream\fP instead of
  12. stderr when showing the progress meter and displaying \fICURLOPT_VERBOSE(3)\fP
  13. data.
  14. If you are using libcurl as a Windows DLL, this option causes an exception and
  15. a crash in the library since it cannot access a FILE * passed on from the
  16. application. A work\-around is to instead use \fICURLOPT_DEBUGFUNCTION(3)\fP.
  17. .SH DEFAULT
  18. stderr
  19. .SH PROTOCOLS
  20. This functionality affects all supported protocols
  21. .SH EXAMPLE
  22. .nf
  23. int main(void)
  24. {
  25. CURL *curl = curl_easy_init();
  26. FILE *filep = fopen("dump", "wb");
  27. if(curl) {
  28. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  29. curl_easy_setopt(curl, CURLOPT_STDERR, filep);
  30. curl_easy_perform(curl);
  31. }
  32. }
  33. .fi
  34. .SH AVAILABILITY
  35. Added in curl 7.1
  36. .SH RETURN VALUE
  37. Returns CURLE_OK
  38. .SH SEE ALSO
  39. .BR CURLOPT_DEBUGFUNCTION (3),
  40. .BR CURLOPT_NOPROGRESS (3),
  41. .BR CURLOPT_VERBOSE (3)