cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl -z option fails with ftp

From: Darryl House <devguru_at_sbcglobal.net>
Date: Tue, 4 Oct 2005 16:53:01 -0700 (PDT)

--- Daniel Stenberg <daniel-curl_at_haxx.se> wrote:

>Hold it here. Was this really what you meant? It
seems you had no local file using that name when you
start curl, so what is it really gonna compare with?

> This specifically says it disables time
conditions...

> Can you show us a trace from when this fails and
there _is_ a local file present?

----
The local file does exist.
Here is a test script in its simplest form and the
resultant output. In this test I have passed an RFC
2822 date to curl -- that is the only date format I
can pass successfully, all others seem to give the
unrecognized error. This format does not, but it
doesn't seem to matter. The  time matches the time on
the remote file but the file is fetched anyway,
regardless of the -z option.
--- begin shell script ---
#!/bin/bash
# ftpuser and ftppass have been obfuscated
ftpuser=user
ftppass=pass
destfile=sat_atlhurr_fullview_640x480.jpg
echo "Local file details (ls -l):"
ls -l $destfile
timestamp=`date -u --rfc-2822 -r "$destfile"`
echo "Timestamp is: $timestamp"
ftp_url="ftp://$ftpuser:$ftppass@imageserv.intelliweather.net/broadcast/test/sat_atlhurr_fullview_640x480.jpg"
curl -v -R -o $destfile -z "$timestamp" $ftp_url
---- end shell script
And here is the output. Note that the local file does
exist, and that the time stamp on the local file is
identical to what FTP says the time is on the remote
file, and that curl still gets the file.
---- begin output ----
Local file details (ls -l):
-rw-r--r--  1 root root 43689 2005-10-04 17:16
sat_atlhurr_fullview_640x480.jpg
Timestamp is: Wed, 05 Oct 2005 00:16:56 +0000
* 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 user
< 331 Password required for iwxtest.
> PASS pass
< 230-Welcome to IntelliWeather Imagery Server
< 230 User user 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 20051005004655
> EPSV
* Connect data stream passively
< 500 'EPSV': command not understood
* disabling EPSV usage
> PASV
< 227 Entering Passive Mode (209,218,29,131,13,65).
*   Trying 209.218.29.131... connected
* Connecting to 209.218.29.131 (209.218.29.131) port
3393
> TYPE I
< 200 Type set to I.
> SIZE sat_atlhurr_fullview_640x480.jpg
< 213 43269
> RETR sat_atlhurr_fullview_640x480.jpg
< 125 Data connection already open; Transfer starting.
* Getting file with size: 43269
  % Total    % Received % Xferd  Average Speed   Time 
  Time     Time  Current
                                 Dload  Upload   Total
  Spent    Left  Speed
 81 43269   81 35004    0     0  24824      0  0:00:01
 0:00:01 --:--:-- 72475Remembering we are in dir
broadcast/test/
< 226 Transfer complete.
100 43269  100 43269    0     0  27504      0  0:00:01
 0:00:01 --:--:-- 66806* Connection #0 to host
imageserv.intelliweather.net left intact
> QUIT
< 221  bye for now...
* Closing connection #0
---- end output ----
bummer.
Received on 2005-10-05