开发者

libcurl and mkdir

开发者 https://www.devze.com 2022-12-15 00:30 出处:网络
I need to use libcurl for creating a folder in my home directory. I use the following set of code for this:

I need to use libcurl for creating a folder in my home directory. I use the following set of code for this:

struct curl_slist *headers = 开发者_运维知识库NULL; 
headers = curl_slist_append(headers, "mkdir MyFolder"); 
curl_easy_setopt(curl, CURLOPT_QUOTE, headers); 

I have given the ftp server-path, user name, password. But, I get the error '500 COmmand not understood'.

I tried using 'pwd' command instead of 'mkdir MyFolder'. It worked without any error.

Can some one help me out to solve this problem.

Thanks in advance.


You should probably use MKD instead of mkdir.

See FILE TRANSFER PROTOCOL (FTP) RFC0959.


Since MKD (MKDIR) is an optional command in the FTP protocol, maybe the FTP server is configured not to allow it? Can you do the MKD on the target server when you connect manually?

0

精彩评论

暂无评论...
验证码 换一张
取 消