我对此一无所知。我需要检查远程 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
变量包含的内容时,它会输出:
CURLE_QUOTE_ERROR (21)。
关于如何正确执行此操作的任何想法?我已经大量搜索了谷歌。