curl-library
Re: SFTP create missing directories
Date: Wed, 13 Jun 2007 10:31:08 -0400
On Jun 13, 2007, at 10:11 AM, Tom Regner wrote:
> On Wednesday, 13. June 2007, James Housley wrote:
>> On Jun 13, 2007, at 7:55 AM, Daniel Stenberg wrote:
>>> On Wed, 13 Jun 2007, James Housley wrote:
>>>>> http://curl.haxx.se/mail/lib-2007-06/0021.html
>>>>
>>>> I have integrated this patch into the code and can commit before
>>>> the release if you like. I am using the patch in this file. It
>>>> is not the way I would like to do it, but SFTP doesn't provide the
>>>> capabilities to do it the way I would really like. There are
>>>> still improvements that can be made, but this does work.
>>>
>>> Fire away! ;-)
>>
>> Done
> [...]
> Cool!
>
> I noticed you used my second patch version as basis for the
> inclusion; do
> you mind to explain why not version 3 ? -- the obligatory opendir at
> the beginning of an upload shouldn't be too costly, should it?
> Since everything else is nearly the same in both versions, I don't
> miss something, I'm just curious (I suspect you had the API-depended
> stuff already incorporated and saw no point in repeating that step
> for almost no change :-) - altough I also cleaned up variable
> naming/declaration and error-reporting a bit.
I still think I would like a more solid way to do this, either with
opendir() or [l]stat(). But, for now so this can make it into the
release #2 was best. It was also getting very messy with the libssh2
non-blocking capability to keep nesting the error loops. Once I get
to move all of that up into the state machine it will be much
cleaner. I also think we can use opendir() or [l]stat() in the
create dirs code so we only have to do what is needed.
>
> [...]
>> It is just not so obvious how this should be mentioned in libcurl/
>> curl_easy_setopt.3
>
> I suggest something in the line of:
>
> *** curl-7.16.3-20070601/docs/libcurl/curl_easy_setopt.3
> 2007-05-31
> 04:00:01.000000000 +0200
> --- curl-7.16.3-20070601.new/docs/libcurl/curl_easy_setopt.3
> 2007-06-13
> 16:00:32.000000000 +0200
> ***************
> *** 890,895 ****
> --- 890,900 ----
> Pass a long. If the value is non-zero, curl will attempt to
> create any
> remote
> directory that it fails to CWD into. CWD is the command that
> changes working
> directory. (Added in 7.10.7)
> +
> + This setting also applies to SFTP-connections. curl will attempt
> to create
> + the remote directory if it can't obtain a handle to the target-
> location. The
> + creation will fail if a file of the same name as the directory to
> create
> + already exists or lack of permissions prevents creation. (Added
> in 7.16.3)
> .IP CURLOPT_FTP_RESPONSE_TIMEOUT
> Pass a long. Causes curl to set a timeout period (in seconds) on
> the amount
> of time that the server is allowed to take in order to generate a
> response
>
>
> As always, my english is not the best, but the paragraph contains the
> information I would like find.
That sounds okay to me too.
Jim
-- /"\ ASCII Ribbon Campaign . \ / - NO HTML/RTF in e-mail . X - NO Word docs in e-mail . / \ ----------------------------------------------------------------- jeh@FreeBSD.org http://www.FreeBSD.org The Power to Serve jim@TheHousleys.Net http://www.TheHousleys.net --------------------------------------------------------------------- Fortune Not Found: Abort, Retry, Ignore?Received on 2007-06-13