cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Problems creating a directory tree with FTP

From: Gerard Cheng <cheng_at_vertigoxmedia.com>
Date: Thu, 22 Aug 2002 15:50:12 -0400

My apologies for the long delay in replying.

I stepped through libCurl with a debugger and found my problem
is related to configuration, probably done incorrectly on my
part.

I had the following libCurl options configured so that no FTP
transfer occured:
        CURLOPT_NOBODY=true
        CURLOPT_HEADER=false

but I also had the following hidden in some residual code I had
not cleaned up yet:
        CURLOPT_UPLOAD=true

This meant that in ftp_perform(), FTPSENDF would still be called
with the "STOR" command and since ftp->file was NULL, the
FTPSENDF would get a bit confused and try to send a file called
"(nil)".

With CURLOPT_UPLOAD=false, everything seems to be fine now.

Thanks for your help.

Gerard

+-----------------------
|> I am using libCurl so to imitate your code snippet I needed to make
|> a series of calls to curl_easy_perform() with:
|> CURLOPT_NOBODY=true
|> CURLOPT_HEADER=false
|> so that no FTP transfer occurs. In each, I tested CWD for each
|> subdirectory of the tree using a QUOTE. For example:
|> CWD a
|> If the return is CURLE_FTP_QUOTE_ERROR, I append a QUOTE to the actual
|> file transfer command to call MKD on that directory:
|> MKD a
|>
|> Repeat this for a/b, a/b/c and so on. Then the actual file transfer
|> will create any subdirectories required.
|>
|> However, with libcurl version 7.9.7 I found that in my testing loop
|> when there should be no transfer, I *intermittantly* get the error
|> CURLE_FTP_COULDNT_STOR_FILE? Why should it be trying to store a file?
|
| I don't know. Can you provide a fully working code snippet that makes
| this problem occur? Or can you possibly single-step into it with a
| debugger to see why it think it should upload a file...
+-----------------------

-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
Received on 2002-08-22