libcurl手册-CURLOPT_WRITEDATA

CURLOPT_WRITEDATA(3) curl_easy_setopt options

CURLOPT_WRITEDATA(3)

NAME

复制代码
   CURLOPT_WRITEDATA - pointer passed to the write callback

SYNOPSIS

cpp 复制代码
#include <curl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_WRITEDATA, void *pointer);

DESCRIPTION

复制代码
   A  data  pointer  to  pass  to the write callback. If you use the CURLOPT_WRITEFUNCTION(3) option, this is the
   pointer you will get in that callback's fourth and last argument. If you do not use a write callback, you must
   make pointer a 'FILE *' (cast to 'void *') as libcurl will pass this to fwrite(3) when writing data.

   The  internal  CURLOPT_WRITEFUNCTION(3) will write the data to the FILE * given with this option, or to stdout
   if this option has not been set.

   If you are using libcurl as a win32 DLL, you MUST use a CURLOPT_WRITEFUNCTION(3) if you set this option or you
   will experience crashes.

要注意Win32 DLL下,如果设置了这个选项,就必须设置CURLOPT_WRITEFUNCTION,否则程序会崩溃。

DEFAULT

复制代码
   By default, this is a FILE * to stdout.

PROTOCOLS

复制代码
   Used for all protocols.

EXAMPLE

复制代码
   A  common  technique  is to use the write callback to store the incoming data into a dynamically growing allo‐
   cated buffer, and then this CURLOPT_WRITEDATA(3) is used to point to a struct or the buffer to store data  in.
   Like in the getinmemory example: https://curl.se/libcurl/c/getinmemory.html

AVAILABILITY

复制代码
   Available  in  all  libcurl  versions. This option was formerly known as CURLOPT_FILE, the name CURLOPT_WRITE‐
   DATA(3) was introduced in 7.9.7.

RETURN VALUE

复制代码
   This will return CURLE_OK.

SEE ALSO

复制代码
   CURLOPT_WRITEFUNCTION(3), CURLOPT_READDATA(3),

libcurl 7.88.1 January 02, 2023 CURLOPT_WRITEDATA(3)

相关推荐
LH_R30 分钟前
OneTerm开源堡垒机实战(四):访问授权与安全管控
运维·后端·安全
用户311879455921843 分钟前
Kylin Linux 10 安装 glib2-devel-2.62.5-7.ky10.x86_64.rpm 方法(附安装包)
linux
Raymond运维1 小时前
MariaDB源码编译安装(二)
运维·数据库·mariadb
涛啊涛2 小时前
Centos7非LVM根分区容量不足后扩容,对调硬盘挂载/
linux·磁盘管理
JuiceFS17 小时前
从 MLPerf Storage v2.0 看 AI 训练中的存储性能与扩展能力
运维·后端
CYRUS_STUDIO21 小时前
用 Frida 控制 Android 线程:kill 命令、挂起与恢复全解析
android·linux·逆向
熊猫李1 天前
rootfs-根文件系统详解
linux
chen9451 天前
mysql 3节点mgr集群部署
运维·后端
LH_R1 天前
OneTerm开源堡垒机实战(三):功能扩展与效率提升
运维·后端·安全
dessler1 天前
Hadoop HDFS-高可用集群部署
linux·运维·hdfs