cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: reading from ftp

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 14 Apr 2002 09:44:39 +0200 (MET DST)

On Sun, 14 Apr 2002, Nedelcho Stanev wrote:

> I have a simple question ( i hope :)
> I need to read from ftp , but easy functions is not ok for me, cuz
> they write data to callback, and i want to do something like
> openconnection()
> while( data )
> read( void* buf)
> closeconnection()

> i mean, that i don't want to start process and work with callbacks, and i
> want to read data from ftp chunk-by-chynk, like fread(). Any can expl. how
> to do this with curl? Transfer() function doest this, and i can copy part
> of sorce in my , but may be some know different way?

Right, you cannot do this with the easy interface, and in fact, you cannot do
this using the multi interface either. The multi interface is probably a lot
closer to what you want though.

To get details about the multi interface, try the online multi overview at
http://curl.haxx.se/libcurl/c/libcurl-multi.html or get a 7.9.6 pre-release
and read the man pages that come with that package.

Anyway, using a callback to get the data instead of getting it in an read()
style, isn't very different.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-04-14