cURL / Mailing Lists / curl-users / Single Mail

curl-users

Determining if curl downloaded a newer file

From: Gerard <gerard_at_seibercom.net>
Date: Sun, 09 Dec 2007 19:27:25 -0500

I have a script that utilizes curl to download AV definition files. I employ
the "-z" option so a file is downloaded only if a newer version is available.
My question is, is there any way to determine, other than doing an explicit
comparison of the files involved, if curl downloaded a newer file? There does
not appear to be an exit code that I could use to determine this. I thought
that the "-w" option might be useful; however, I cannot figure out how to
capture it and use it in a variable. I was thinking that the "size_download"
would be useful; however, I cannot figure out how to capture the value into a
useful variable.

I would welcome any suggestions.

-- 
Gerard
Received on 2007-12-10