Well, I found out how to check if a file exists even though it's problem not the best way. Just call:
Code:
curl_easy_setopt(curl, CURLOPT_URL, "ftp://user:[email protected]/filetocheck");
Then, when you get the result:
Code:
res = curl_easy_perform(curl);
That will report with an error (PERIOD). However, THE FIRST error that is produced is:
CURLE_FTP_COULDNT_RETR_FILE
The only time that error is produced is if CURL could "RETR"ieve the file, meaning the file doesnt exist if that error is produced. Otherwise, different errors are produced (like, couldn't write retrieved data to application). I really dont care what error is produced, I just want to know if CURL could "RETR"ieve the file or not. So for those who are using this as an example, this is what you do after you get the results in res:
Code:
if(res==CURLE_FTP_COULDNT_RETR_FILE) {
MessageBox(0, "File Doesnt Exist code belongs here", "Result", 0);
} else {
MessageBox(0, "File Does Exist code belongs here", "Result", 0);
}
Thanks for your help (also, res wont contain the results of the command you enter; it returns the error in running the commands. So if it performs successfully, then the error is CURLE_OK, which doesnt help me).