[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: question on urlwrite ftp request.
From: |
David Bateman |
Subject: |
Re: question on urlwrite ftp request. |
Date: |
Mon, 01 Mar 2010 04:47:33 +0100 |
User-agent: |
Mozilla-Thunderbird 2.0.0.22 (X11/20090706) |
Marco Atzeri wrote:
On recente source build on cygwin, I noticed that
urlwrite is working for http but not for ftp,
and the output is puzzling.
octave:5> [S, SUCCESS, MESSAGE] = urlread
("ftp://ftp.octave.org/pub/octave/README")
S =
SUCCESS = 0
MESSAGE = No error
octave:6> S = urlread ("ftp://ftp.octave.org/pub/octave/README")
error: urlread: curl: No error
It seems a mismatch between octave format expectation
and curl output. Anyone see it on other platform ?
Regards
Marco
This worked when I originally wrote the @ftp objects. Though the changeset
http://hg.savannah.gnu.org/hgweb/octave/rev/57b41617c9fd
broke it. The patch should fix it, though I can't commit it at the moment
D.
diff --git a/src/DLD-FUNCTIONS/urlwrite.cc b/src/DLD-FUNCTIONS/urlwrite.cc
--- a/src/DLD-FUNCTIONS/urlwrite.cc
+++ b/src/DLD-FUNCTIONS/urlwrite.cc
@@ -563,7 +563,8 @@
std::string userpwd = user;
if (! passwd.empty ())
userpwd += ":" + passwd;
- setopt (CURLOPT_USERPWD, userpwd.c_str ());
+ if (! userpwd.empty ())
+ setopt (CURLOPT_USERPWD, userpwd.c_str ());
// Define our callback to get called when there's data to be written.
setopt (CURLOPT_WRITEFUNCTION, write_data);