2
0
mirror of https://codeberg.org/kiss-community/repo synced 2025-01-09 04:05:07 -07:00
repo/core/curl/files/CURLOPT_NETRC_FILE.3

46 lines
1.3 KiB
Groff
Raw Normal View History

.\" generated by cd2nroff 0.1 from CURLOPT_NETRC_FILE.md
2024-08-02 19:52:59 -06:00
.TH CURLOPT_NETRC_FILE 3 "2024-08-02" 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.
.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)