cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to download only new files from FTP server

From: Ankur Saxena <saxena.ank_at_gmail.com>
Date: Tue, 1 Sep 2009 17:48:26 -0400

I worked on this recently. I get a list of files from the remote server. I
maintain a persistent curl handle to get the file listing, I am setting the
URL (to the appropriate directory) and user/passwd, and calling
curl_easy_perform on the handle at regular intervals.

Here's what I noticed:

When a new file is added to the server, the response (file listing) shows
that file, and the my app parses the response and downloads the new file --
this is ok.

However, when I change the size and/or time stamp of an already existing
file on the server, the response still shows me the old size and timestamp
for that file.

If I stop and restart my app, it gets the correct file listing info.

I am wondering if curl or FTP server caches file listing info.
Any comments are appreciated.

Thank you.
On Wed, Aug 19, 2009 at 4:20 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:
>
>
> Uhm, that's exactly what wget does so if you do that with a persistent
> connection instead of disconnect/reconnect all the time, you should be
> getting better performance. Of course, if you're transferring large (or few)
> files the difference might not be that noticable.
>
> --
>
> / daniel.haxx.se
>
Received on 2009-09-01