curl-users
Re: a problem with -z
Date: Thu, 11 Jan 2001 00:06:53 +0100 (MET)
On Wed, 10 Jan 2001, David West wrote:
> On my Slackware machine (kernel 2.0.36, libc5), -z appeared to work
> properly at the end of Dec 2000, but appears not to work properly now
> (yes, all machines involved agree that the year is 2001, and more or less
> agree on the time, see below :-)) The situation is similar on the remote
> Redhat machine.
Are you saying all other circumstances are identical, only a new version of
curl was introduced?
> curl -z timestamp -# -O ftp://myname:mypasswd@myremotehost.org/tmp/mirror.log
I'm sorry to say that -z is not working for FTP files (I just checked, the
--help text as well as the man page mention this fact). It's very hard to
ever get that to work since there's no standard way of getting a file's date
using FTP.
Just for the record, I just tried this myself (I should write a test case for
this for the test suite) using HTTP:
% ls -l localtime ~/public_html/timestamp
-rw-r--r-- 1 daniel Jan 10 23:38 localtime
-rw-r--r-- 1 daniel Jan 10 23:37 /home/daniel/public_html/timestamp
And then, I tried getting the 'timestamp' file if newer than 'localtime':
% curl -z localtime localhost/~daniel/timestamp -v
* Connected to localhost.localdomain (127.0.0.1)
> GET /~daniel/timestamp HTTP/1.0
User-Agent: curl/7.6-pre1 (i686-pc-linux-gnu) libcurl 7.6-pre1
Host: localhost
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
If-Modified-Since: Wed, 10 Jan 2001 23:38:30 CET
* The requested document is not new enough
% touch ~/public_html/timestamp
% ls -l localtime ~/public_html/timestamp
-rw-r--r-- 1 daniel Jan 10 23:38 localtime
-rw-r--r-- 1 daniel Jan 11 00:07 /home/daniel/public_html/
% curl -z localtime localhost/~daniel/timestamp -v
* Connected to localhost.localdomain (127.0.0.1)
> GET /~daniel/timestamp HTTP/1.0
User-Agent: curl/7.6-pre1 (i686-pc-linux-gnu) libcurl 7.6-pre1
Host: localhost
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
If-Modified-Since: Wed, 10 Jan 2001 23:38:30 CET
test content
-- Daniel Stenberg -- curl project maintainer -- http://curl.haxx.se/Received on 2001-01-11