cURL / Mailing Lists / curl-library / Single Mail

curl-library

Remembering we are in dir //xxx/yyy/ when //xxx/yyy/ is not a valid dir

From: Barry Baker <barbaker_at_gmail.com>
Date: Fri, 20 Jan 2006 15:59:24 -0500

Hello,
I'm writing an interactive FTP Client over top of libcurl and making use of
persistent connections. After establishing a connection to a remote FTP
server, if I issue an LS command (always passing libcurl an absolute path)
of a directory that does not exist the first attempt fails. If is issue the
same request immediately after the first, I then get a directory listing for
the deapest portion of the path that is valid. Meaning if my request was
for //xxx/yyy/ and xxx is valid but yyy is not, then I get a directory
listing of xxx.

here is some verbose output:

> CWD /
< 250 HFS directory / is the current working directory
> CWD etc
< 250 HFS directory /etc is the current working directory
> CWD sadlkjfsa
< 550 CWD cmd failed : EDC5129I No such file or directory.
(errno2=0x05190050)
* Remembering we are in dir //etc/sadlkjfsa/
* Connection #0 to host xxx.xxx.xxx left intact
* Re-using existing connection! (#0) with host xxx.xxx.xxx
* Connected to xxx.xxx.xxx (xxx.xxx.xxx.xxx) port 21
* Request has same path as previous transfer
> EPSV
* Connect data stream passively
< 229 Entering Extended Passive Mode (|||2642|)
* Trying xxx.xxx.xxx.xxx... * connected
* Connecting to xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx) port 2642
> TYPE A
< 200 Representation type is Ascii NonPrint
> LIST
< 125 List started OK

It appears that libcurl is incorrectly remembering what the current working
directory is.

Any suggestions?

thanks,
barry
Received on 2006-01-20