cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Seeking functionality during download

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 7 May 2009 13:33:37 +0200 (CEST)

On Thu, 7 May 2009, centrio_at_gmail.com wrote:

> I want to know if curl has any seeking functionality to seek into a stream
> which is getting downloaded. I found function CURLOPT_SEEKFUNCTION but it
> can be used for uploading only. However for downloading there are some
> options available like CURLOPT_RANGE CURLOPT_RESUME_FROM and
> CURLOPT_RESUME_FROM_LARGE . How can I achienve the seeking functionality
> using this. I want to seek depending upon the offset and the position from
> where the offset begins. Like we have SEEK_SET, SEEK_CUR and SEEK_END in
> seek function, i need similar functionality for download. Please help. Is
> there any direct way to achieve this using libcurl or do i have to create my
> own logic to set proper offset for download depending upon position.?

The protocols libcurl supports don't really support seeking. You can start the
download at a specific point though, and ask for ranges. So yeah, you'd have
to craft your own magic around what libcurl offers.

-- 
  / daniel.haxx.se
Received on 2009-05-07