.\" generated by cd2nroff 0.1 from CURLOPT_NETRC_FILE.md .TH CURLOPT_NETRC_FILE 3 "2024-11-07" libcurl .SH NAME CURLOPT_NETRC_FILE \- filename to read .netrc info from .SH SYNOPSIS .nf #include 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. 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 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 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)