curl-users
Re: FTP rename
Date: Tue, 28 Aug 2001 13:30:52 +0200 (MET DST)
On Tue, 28 Aug 2001, Erick Nuwendam wrote:
[Ok, so specific libcurl questions are better dealt with on the libcurl
mailing list, but...]
> So, I can use the setopt command with the POSTQUOTE option with a pointer
> giving the adress of a cell containing the text of my command.
>
> example : "rename /tmp/test /tmp/zaza"
>
> Does this works ?
No.
First, read the curl docs for the QUOTE/POSTQUOTE option:
CURLOPT_QUOTE
Pass a pointer to a linked list of FTP commands to
pass to the server prior to your ftp request. The
linked list should be a fully valid list of 'struct
curl_slist' structs properly filled in. Use
curl_slist_append(3) to append strings (commands) to
the list, and clear the entire list afterwards with
curl_slist_free_all(3)
Then, you must realize that the "list of FTP commands" this is refering to,
is the plain-text FTP commands that you want to send to the remote server.
How to send rename to a FTP server is documented in RFC959 section 4.1.3.
There it says:
RENAME FROM (RNFR)
This command specifies the old pathname of the file which is
to be renamed. This command must be immediately followed by
a "rename to" command specifying the new file pathname.
RENAME TO (RNTO)
This command specifies the new pathname of the file
specified in the immediately preceding "rename from"
command. Together the two commands cause a file to be
renamed.
... so you must add two separate command lines.
-- Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/Received on 2001-08-28