cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: PATCH: ftp.c force directory exists on upload, minor bugfix.

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 5 Aug 2003 21:50:02 +0200 (CEST)

On Tue, 5 Aug 2003, Early Ehlinger wrote:

> diff -u curl-7.10.6/lib/ftp.c orig/curl-7.10.6/lib/ftp.c > ftp.diff
>
> Attached - I don't believe I've changed it any since yesterday.

Right, but things in my end changed! ;-) Now the dir problem is fixed here...

> I agree, this is definitely *NOT* what you would usually want libcurl to do
> by default. In fact, with the patch the way it is, it *might* cause
> directories to be created during a download, unless I'm missing something.
> Clearly BAD. This is why I'd rather it be a curl_easy_setopt option,
> something like CURL_FTP_FORCE_REMOTE_DIRECTORY.

CURLOPT_FTP_CREATE_MISSING_DIRS perhaps.

> As a client of libcurl, it seems more intuitive when trying to upload a file
> to say "put it there, no matter whether that directory exists before I
> upload or not. Just do it." Clearly this would not be what you would want
> by default, but I believe it adds real value to the library, much like the
> ability to upload only if the file has changed (amazing work on that front,
> guys! Works like a charm!).

I think I agree, based on the fact that lots of people have asked about a
feature like this in the past so I think it will get used.

> > To add a new option

[snip]

> Thanks! I'll take a look later today or possibly tomorrow morning; assuming
> all goes well, I should have a new patch shortly thereafter, with
> ftp_force_cwd as an option rather than a hard-coded patch.

If you get around to do it before I release the next release, please consider
doing the patch against the CVS version.

Also, if you wanna become my best friend: provide test cases and documentation
for the new stuff you bring. It saves me from having to do all that...

> > Well, does all the tests still run fine?
>
> As I mentioned, I'm really a curl/libcurl newbie. This patch is extremely
> peripheral to what I'm really trying to accomplish, so I haven't had the
> time to validate it thoroughly nor to research *how* to validate it
> thoroughly.

'make test' in curl's root dir should run the 100+ test cases 100% fine, or
else your changes have modified something that it shouldn't.

> If I can make some time I'll try to figure out how your test system works
> and put the patch through its paces, but schedules are excruciatingly tight
> these days and I can't promise much on that front.

Time is always scares for everyone of us. And it won't change in the future
either. I'd rather wait a little extra while and get more quality than getting
a lesser job done fast.

That said, I do of course appreciate your hard work even if you don't provide
test cases and thick books of documentation. I'm only expressing my desire!
;-)

Thanks for your contribution!

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Received on 2003-08-05