cURL / Mailing Lists / curl-library / Single Mail


Re: Setting Local Directory for an ftpget

From: SuperManager Customer Support <>
Date: Mon, 19 Dec 2011 09:26:52 -0500


Thanks for your response. I actually did spend a decent amount of time
looking at the documentation, including that example.

I see where the file_is_comming callback opens the file using a filename
that I assumed was passed by curl in the fileinfo struct. My assumption
was that the filename curl passes to the callback function is the name of
the file it found on the ftp server. Note that I am using the wildcard
ftpget example. Perhaps it varies from the regular ftp example. I need to
know how to set a directory name in front of the filename when opening the
file. As I tried to explain, but perhaps didn't do well was that I need to
be able to specify that directory at runtime rather than compile it into
the code.

On Dec 19, 2011 8:24 AM, "Daniel Stenberg" <> wrote:

> On Mon, 19 Dec 2011, SuperWare Support wrote:
> I'm implementing an ftp get using libcurl. I searched the documentation,
>> but couldn't find an option for setting the local directory to write the
>> file to.
> This sounds like you've not really looked into the documentation. libcurl
> won't save to any file name at all, you never provide that. You take care
> of the saving basically. Have a look at this example:
> I know I could modify the file_is_comming callback function to set it to
>> a static location
> Why would you have it static if you want to have it changeable? Just
> change it as you like!
> --
> /
> ------------------------------**------------------------------**-------
> List admin:**listinfo/curl-library<>
> Etiquette:**etiquette.html<>

List admin:
Received on 2011-12-19