cURL / Mailing Lists / curl-library / Single Mail


Re: SFTP create missing directories

From: James Housley <>
Date: Wed, 13 Jun 2007 12:27:29 -0400

On Jun 13, 2007, at 11:58 AM, Tom Regner wrote:

> On Wednesday, 13. June 2007, James Housley wrote:
>> On Jun 13, 2007, at 11:00 AM, Tom Regner wrote:
>>> On Wednesday, 13. June 2007, James Housley wrote:
>>> [...]
>>>> 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.
>>> [...]
>>>> I also think we can use opendir() or [l]stat() in the
>>>> create dirs code so we only have to do what is needed.
>>> Definitly - I simply scratched my itch by reading the docs at
>>> and
>>> libssh2-includes for the minimum I needed to implement a
>>> working version as fast as possible.
>>> I now took a look at what is there, and FWIW I think we should use
>>> stat to
>>> gather the necessary informations (possibly not up the path as it
>>> is now
>>> done, but down the path, as it is likely that directories down the
>>> path
>>> already exist), and attempt creation only after checking what
>>> libssh2_sftp_stat returns.
>>> I think I can't help with anything concerning the state-machine,
>>> but I would
>>> reimplement sftp_create_dirs accordingly if that's ok with you.
>> Go a head and update it. You can just do the one section that
>> matches your libssh2 version if you like and I will do the other.
> Ok - have something nearly ready, but it's off to home and kids
> time - code
> comes tomorrow. Shall I continue to post patches, or is it from now
> on better
> I simply mail the function-snippet - whatever is easier for you to
> include
> into your codebase.

Enjoy. Mail the function when you are happy with it.


/"\   ASCII Ribbon Campaign  .
\ / - NO HTML/RTF in e-mail  .
  X  - NO Word docs in e-mail .
/ \ -----------------------------------------------------------------     The Power to Serve
Progress (n) : What led from smart users in front of dumb terminals to
dumb users in front of smart terminals.
Received on 2007-06-13