On Monday 12 May 2008 1:23 am, Mark Chandler wrote:
> Well im in need of a http library which will allow me to part download
> files. Now is there any easy way to use libcur to do this. I would like to
> be able to use it like fseek and fread for files.
>

libcURL has those following options:

CURLOPT_SEEKFUNCTION

Function pointer that should match the following prototype: int function(void 
*instream, curl_off_t offset, int origin); This function gets called by 
libcurl to seek to a certain position in the input stream and can be used to 
fast forward a file in a resumed upload (instead of reading all uploaded 
bytes with the normal read function/callback). It is also called to rewind a 
stream when doing a HTTP PUT or POST with a multi-pass authentication method. 
The function shall work like "fseek" or "lseek" and accepted SEEK_SET, 
SEEK_CUR and SEEK_END as argument for origin, although (in 7.18.0) libcurl 
only passes SEEK_SET. The callback must return 0 on success as returning 
non-zero will cause the upload operation to fail.

If you forward the input arguments directly to "fseek" or "lseek", note that 
the data type for offset is not the same as defined for curl_off_t on many 
systems! (Option added in 7.18.0)

CURLOPT_SEEKDATA

Data pointer to pass to the file read function. If you use the 
CURLOPT_SEEKFUNCTION option, this is the pointer you'll get as input. If you 
don't specify a seek callback, NULL is passed. (Option added in 7.18.0) 

----
Currently, there's no wrapper around those options in cURLpp. I'll try to add 
those for the next version. However it shouldn't be there until a month.

>
>
> Any help (or other librarys that can) would be appreciated.
>
>
>
> Mark

-- 
Jean-Philippe Barrette-LaPierre
_______________________________________________
cURLpp mailing list
[email protected]
http://www.rrette.com/mailman/listinfo/curlpp

Reply via email to