这个问题让我感到非常无助。我需要检查远程FTP服务器上是否存在一个目录。我的想法是:
//ls - lists the names of the files in the remote directory
string query = "ls /public_html/somefolder/";
//prepare to send
headers = curl_slist_append(headers, query.c_str());
curl_easy_setopt(curl, CURLOPT_QUOTE, headers);
//send query to ftp server
res = curl_easy_perform(curl);
//check result
if(res == CURLE_OK) {
cout << "FOLDER EXISTS";
} else {
cout << "FOLDER DOESN'T EXIST";
}
当我检查
res
变量包含的内容时,输出为:有没有正确处理的想法?我已经在Google上搜索了很多。CURLE_QUOTE_ERROR (21).