curl-library
problem with rename a remote sFTP file
Date: Mon, 20 Oct 2008 18:03:08 +0800
the code below seems not to work for me,one time it turns back success information,bu the remote file keeps same as old, next time it shows:Unknown SFTP command!
what's wrong?
struct curl_slist * headerlist = NULL;
CString command_renamefrom = "RNFR ";
CString command_renameto = "RNTO ";
CString CommandBuffer_renamefrom = command_renamefrom + OldFilename;
CString CommandBuffer_renameto = command_renameto + NewFilename;
/* specify target */
curl_easy_setopt(hCurl, CURLOPT_URL, sFtpFilePath);
/* pass commands to libcurl list */
headerlist = curl_slist_append(headerlist, CommandBuffer_renamefrom);
headerlist = curl_slist_append(headerlist, CommandBuffer_renameto);
/* pass in that last of sFTP commands to run */
curl_easy_setopt(hCurl, CURLOPT_POSTQUOTE, headerlist);
curl_easy_setopt(hCurl, CURLOPT_USERPWD, bsUserPassword);
/*perform now! */
nCurlResult = curl_easy_perform(hCurl);
-------------------------------------------------------------------
新浪空间——与朋友开心分享网络新生活!(http://space.sina.com.cn/ )
Received on 2008-10-20