1CURLOPT_NETRC_FILE(3) curl_easy_setopt options CURLOPT_NETRC_FILE(3)
2
3
4
6 CURLOPT_NETRC_FILE - file name to read .netrc info from
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_NETRC_FILE, char
12 *file);
13
15 Pass a char * as parameter, pointing to a null-terminated string con‐
16 taining the full path name to the file you want libcurl to use as
17 .netrc file. If this option is omitted, and CURLOPT_NETRC(3) is set,
18 libcurl will attempt to find a .netrc file in the current user's home
19 directory.
20
21 The application does not have to keep the string around after setting
22 this option.
23
25 NULL
26
28 All
29
31 CURL *curl = curl_easy_init();
32 if(curl) {
33 CURLcode ret;
34 curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/");
35 curl_easy_setopt(curl, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);
36 curl_easy_setopt(curl, CURLOPT_NETRC_FILE, "/tmp/magic-netrc");
37 ret = curl_easy_perform(curl);
38 }
39
41 Added in 7.10.9
42
44 Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if
45 not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space.
46
48 CURLOPT_NETRC(3), CURLOPT_USERNAME(3),
49
50
51
52libcurl 7.79.1 November 04, 2020 CURLOPT_NETRC_FILE(3)