cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: SFTP and CURLOPT_RANGE

From: Ian Lynagh <igloo_at_earth.li>
Date: Fri, 12 Sep 2008 11:40:15 +0100

Hi Wei,

On Fri, Sep 12, 2008 at 12:40:30AM -0400, Wei Weng wrote:
> Ian Lynagh wrote:
> >
> > half way there. Unfortunately, due to unfamiliarity with the code, I
> > haven't managed the other half yet, and I don't have any more time to work on
> > this at the moment. Presumably all that is needed is to tell curl how
> > many bytes to download, somehow. I'd be delighted if someone was able to
> > finish this off, or give me some clues on how to do so myself.
>
> Can not you use SSH_FXP_STAT to get the file size?
> (http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-8.5)
>
> And then deduct the range from the size to get the length you wanna
> download/upload from the file.

My problem is not how to find the file size, but how to tell curl/libssh
how many bytes to download.

For example, if the range is "34384-34394" then I know how to say "start
at 34384", but not "get 11 bytes" (or equivalently, "stop at 34394").

Thanks
Ian
Received on 2008-09-12