cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: ignore small files

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Thu, 1 Jan 2015 20:25:34 +0100

On Thu, Jan 01, 2015 at 07:13:19PM +0100, michael straub wrote:
> I'm searching for a solution to download Files from a FTP server, it
> contains Fotos, made by DSRL and uploaded to Shutter Snitch ap to a iPad.
> Problem is sometimes files hava 0 byte, while download them I what to ignore
> those files. I found there is a --max-size option, but I'd need a min file
> option, maybe its possibal to negate it? THX Michael

There's no built-in option to do that, but you can accomplish this a number of
ways through scripting. curl doesn't do recursive downloads, so during the
stage where you get the list of files to download, you can simply filter out
the 0-length ones and avoid transferring them. Or, you could just transfer them
anyway and delete the empty ones. Using HTTP, you could probably use an
If-Range: header to skip such files, but that really wouldn't save you any
network bandwidth or latency.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-01-01