cURL / Mailing Lists / curl-users / Single Mail

curl-users

curl -z option fails with ftp

From: Darryl House <devguru_at_sbcglobal.net>
Date: Tue, 4 Oct 2005 09:23:27 -0700 (PDT)

When I use the -z option and obtain a timestamp from a
file name, it works well with HTTP, but fails with
FTP.

For example, this command will always fetch a file,
even though the timestamp on the local file is
identical to that on the server:

curl -R -o destfile -z destfile ftp_url

I can work around this by obtaining the timestamp from
the local file myself, but since this is an advertised
feature (and a cool one, at that!) I thought you
should know.

As requested, here is more info from using this
command with a verbose output (user names and
passwords have been yoinked):

root_at_wxframe:~# curl -v -R -o
sat_atlhurr_fullview_640x480.jpg -z
sat_atlhurr_fullview_640x480.jpg
ftp://<yoink>:<yoink>@imageserv.intelliweather.net/broadcast/test/sat_atlhurr_fullview_640x480.jpg
Warning: Illegal date format for -z/--timecond (and
not a file name).
Warning: Disabling time condition. See curl_getdate(3)
for valid date syntax.
* About to connect() to imageserv.intelliweather.net
port 21
* Trying 209.218.29.131... connected
* Connected to imageserv.intelliweather.net
(209.218.29.131) port 21
< 220 imageserv Microsoft FTP Service (Version 5.0).
> USER <yoink>
< 331 Password required for <yoink>.
> PASS <yoink>
< 230-Welcome to IntelliWeather Imagery Server
< 230 User <yoink> logged in.
* We have successfully logged in
> PWD
< 257 "/" is current directory.
* Entry path is '/'
> CWD broadcast
< 250 CWD command successful.
> CWD test
< 250 CWD command successful.
> MDTM sat_atlhurr_fullview_640x480.jpg
< 213 20051004164654
> EPSV
< 500 'EPSV': command not understood
> PASV
< 227 Entering Passive Mode (209,218,29,131,7,240).
* Trying 209.218.29.131... connected
* Connecting to 209.218.29.131 (209.218.29.131) port
2032
* Connected the data stream with PASV!
> TYPE I
< 200 Type set to I.
> SIZE sat_atlhurr_fullview_640x480.jpg
< 213 45179
> RETR sat_atlhurr_fullview_640x480.jpg
< 125 Data connection already open; Transfer starting.
* Getting file with size: 45179
  % Total % Received % Xferd Average Speed Time
  Time Time Current
                                 Dload Upload Total
  Spent Left Speed
  3 45179 3 1448 0 0 832 0 0:00:54
 0:00:01 0:00:53 832226 Transfer complete.
100 45179 100 45179 0 0 21353 0 0:00:02
 0:00:02 --:--:-- 113k
* Connection #0 to host imageserv.intelliweather.net
left intact
> QUIT
< 221 bye for now...
* Closing connection #0
root_at_wxframe:~#
Received on 2005-10-04