cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: absolute paths only

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 26 Sep 2007 13:18:28 +0200 (CEST)

On Wed, 26 Sep 2007, junk_at_igrspace.com wrote:

> Obviously, the default value of CURLOPT_FTP_ABSONLY is false, so without
> specifying it to true, libcurl works just like it does now.
>
> Yes, when setting it to true, libcurl expects the user to specify an
> absolute path. And this should be documented.
>
> If the user specifies CURLOPT_FTP_ABSONLY, but does not supply an absolute
> path, then things will probably go wrong upon the next transfer. In other
> words, the user should 'know what he is doing'.

Right, but it would be very easy to just check if the first letter in the path
is a slash or not and just return an error if not? Or perhaps it would be even
better to prepend a slash for that case if that option is enabled?

I know and I agree that users are supposed to know what the options do and
comply with the rules they dictate, but that still doesn't prevent users from
doing wrong occasionally and when doing wrong it helps users if the library
behaves in a way that makes it somewhat easy to backtrack from the failure.
So, while it isn't worth bending over backwards for I still think it is worth
at least consider and discuss properly before dismissing the idea completely.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-09-26