libcurl und ftp Kommandos



  • Hallo zusammen,

    ich versuche über libcurl einen ftp-server zu steuern. Ich würde dazu gern die Kommandos mkdir und cd benutzen.
    Im Inet habe ich dazu nicht wirklich viel gefunden. Hier mal meine Routine bis jetzt, es scheint aber nicht zu klappen. Hat jemand einen Tipp?

    ...
    	CURL *curl;
    	CURLcode res;
    
    	struct curl_slist* commands = NULL ;
    	commands = curl_slist_append( commands , "mkdir /tmp/test1" ) ;
    
       	curl_global_init(CURL_GLOBAL_DEFAULT);
       	curl = curl_easy_init();
    
    	if (curl)
    	{
    		curl_easy_setopt(curl, CURLOPT_URL, "ftp://login:pwd@192.168.178.1/");
    		curl_easy_setopt( curl , CURLOPT_QUOTE , commands ) ;
    		res = curl_easy_perform(curl);
    		curl_slist_free_all( commands ) ;
    
       		if(CURLE_OK != res) 
    		{
    			cout << "Curl Error." << endl;
    		}
    
    		curl_easy_cleanup(curl);
    	}
    	curl_global_cleanup();
    ...
    

Anmelden zum Antworten