开发者

libcurl and mkdir

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜