curl / Mailing Lists / curl-library / Single Mail

curl-library

Ftp client commands

From: Alexander Eisenhuth <ae_at_stacom-software.de>
Date: Mon, 30 Apr 2018 16:09:31 +0200

Hello Everybody,

I'm writing a ftp client in c++ with the easy interface, that has beside
the upload/download functionality others like:

mkdir(dirName)
rmdir(dieName)
rm(fileName)
cd(dirName)

I used for that the CURLOPT_CUSTOMREQUEST option in the way

curl_easy_setopt(mCurl, CURLOPT_CUSTOMREQUEST, "rmdir /anydir"))

Basicly it works, but in the debug traces I can see that libcurl is
expecting a tranfer as it is sending the PORT command

Example with FTPClient::cd("..")
=========================
13:39:50.554: FINE: Network.FTPClient: >FTPClient::cd
13:39:50.554: FINE: Network.FTPClient: libcurl * Found bundle for host
127.0.0.1: 0x18b354c9330 [serially]
13:39:50.554: FINE: Network.FTPClient: libcurl * Re-using existing
connection! (#0) with host 127.0.0.1
13:39:50.554: FINE: Network.FTPClient: libcurl * Connected to 127.0.0.1
(127.0.0.1) port 21 (#0)
13:39:50.554: FINE: Network.FTPClient: libcurl * Request has same path
as previous transfer
13:39:50.555: FINE: Network.FTPClient: libcurl * Hostname 127.0.0.1 was
found in DNS cache
13:39:50.555: FINE: Network.FTPClient: libcurl > PORT 127,0,0,1,226,173
13:39:50.555: FINE: Network.FTPClient: libcurl * ftp_perform ends with
SECONDARY: 1
13:39:50.555: FINE: Network.FTPClient: libcurl < 200 Port command
successful
13:39:50.556: FINE: Network.FTPClient: libcurl * Connect data stream
actively
13:39:50.556: FINE: Network.FTPClient: libcurl > CWD ..
13:39:50.556: FINE: Network.FTPClient: libcurl < 250 CWD successful. "/"
is current directory.
13:39:50.556: FINE: Network.FTPClient: libcurl * RETR response: 250
13:39:50.556: FINE: Network.FTPClient: libcurl * Remembering we are in
dir "subdir/"
13:39:50.557: FINE: Network.FTPClient: libcurl * Connection #0 to host
127.0.0.1 left intact
13:39:50.557: FINE: Network.FTPClient: <FTPClient::cd errorCode:0

So what is the right way to implement a ftp client API for non transfer
functionality like mkdir, rmdir, ...

Thanks a lot for your help
Greetings Alex

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2018-04-30