2
0
mirror of https://codeberg.org/kiss-community/repo synced 2025-01-08 10:40:17 -07:00
repo/core/curl/files/CURLOPT_NETRC_FILE.3

49 lines
1.5 KiB
Groff
Raw Normal View History

.\" generated by cd2nroff 0.1 from CURLOPT_NETRC_FILE.md
2024-09-24 23:13:55 -06:00
.TH CURLOPT_NETRC_FILE 3 "2024-09-25" libcurl
.SH NAME
CURLOPT_NETRC_FILE \- filename to read .netrc info from
.SH SYNOPSIS
.nf
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_NETRC_FILE, char *file);
.fi
.SH DESCRIPTION
Pass a char pointer as parameter, pointing to a null\-terminated string
containing the full path name to the \fIfile\fP you want libcurl to use as .netrc
file. If this option is omitted, and \fICURLOPT_NETRC(3)\fP is set, libcurl checks
for a .netrc file in the current user\(aqs home directory.
The application does not have to keep the string around after setting this
option.
2024-09-15 18:10:01 -06:00
Using this option multiple times makes the last set string override the
previous ones. Set it to NULL to disable its use again.
.SH DEFAULT
NULL
.SH PROTOCOLS
2024-07-29 18:00:04 -06:00
This functionality affects all supported protocols
.SH EXAMPLE
.nf
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode ret;
curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/");
curl_easy_setopt(curl, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);
curl_easy_setopt(curl, CURLOPT_NETRC_FILE, "/tmp/magic-netrc");
ret = curl_easy_perform(curl);
}
}
.fi
.SH AVAILABILITY
2024-07-29 18:00:04 -06:00
Added in curl 7.11.0
.SH RETURN VALUE
Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
CURLE_OUT_OF_MEMORY if there was insufficient heap space.
.SH SEE ALSO
.BR CURLOPT_NETRC (3),
.BR CURLOPT_PASSWORD (3),
.BR CURLOPT_USERNAME (3)