cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Setting Local Directory for an ftpget

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

Daniel,

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.

Thanks,
David
On Dec 19, 2011 8:24 AM, "Daniel Stenberg" <daniel_at_haxx.se> 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:
>
> http://curl.haxx.se/libcurl/c/**ftpget.html<http://curl.haxx.se/libcurl/c/ftpget.html>
>
> 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!
>
> --
>
> / daniel.haxx.se
> ------------------------------**------------------------------**-------
> List admin: http://cool.haxx.se/list/**listinfo/curl-library<http://cool.haxx.se/list/listinfo/curl-library>
> Etiquette: http://curl.haxx.se/mail/**etiquette.html<http://curl.haxx.se/mail/etiquette.html>
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-12-19