cURL / Mailing Lists / curl-users / Single Mail

curl-users

about -w

From: Sebastien WILLEMIJNS <sebastien_at_willemijns.com>
Date: Sun, 12 Dec 2004 14:47:11 +0100 (CET)

hello,

i'm on win98se with lastest curl release

there's a problem with "-w" :X

we can see in http://curl.haxx.se/docs/manual.html this part of text:
CUSTOM OUTPUT
   To better allow script programmers to get to know about the progress of
  curl, the -w/--write-out option was introduced. Using this, you can specify
  what information from the previous transfer you want to extract.
   To display the amount of bytes downloaded together with some text and an
  ending newline:
        curl -w 'We downloaded %{size_download} bytes\n' www.download.com

let's try it this feature:

curl -T file1kb -u vivil:xxxxxxxxx -i -v ftp://ftpperso.free.fr/ -w 'We uploaded %%{size_upload} bytes\n'
  
* About to connect() to ftpperso.free.fr port 21
* Trying 212.27.40.252... * connected
* Connected to ftpperso.free.fr (212.27.40.252) port 21
< 220 Serveur de mise a jour des pages perso de Free.fr version [Sep 22 2004 01:22:45]
> USER vivil
< 331 Password required for vivil.
> PASS xxxxxxxxx
< 230 User vivil logged in.
* We have successfully logged in
> PWD
< 257 "/" is current directory.
* Entry path is '/'
> EPSV
< 500 'EPSV': command unrecognized.
> PASV
< 227 Entering Passive Mode (212,27,40,252,69,144).
* Trying 212.27.40.252... * connected
* Connecting to 212.27.40.252 (212.27.40.252) port 17808
* Connected the data stream with PASV!
> TYPE I
< 200 Type set to I
> STOR file1kb
< 150 Opening BINARY mode data connection for file1kb
< 226 Transfer complete.
* Connection #0 to host ftpperso.free.fr left intact
'We* Could not resolve host: uploaded; Host not found
* Closing connection #1
'Wecurl: (6) Could not resolve host: uploaded; Host not found
* Could not resolve host: %size_upload; Host not found
* Closing connection #1
'Wecurl: (6) Could not resolve host: %size_upload; Host not found
* Could not resolve host: bytes\n'; Host not found
* Closing connection #1
'Wecurl: (6) Could not resolve host: bytes\n'; Host not found
> QUIT
< 221 Goodbye.
* Closing connection #0

let's try again with same text without spaces, it works !
  
  
curl -T file1kb -u vivil:xxxxxxxxx -i -v ftp://ftpperso.free.fr/ -w 'Weuploaded%%{size_upload}bytes\n'
  
* About to connect() to ftpperso.free.fr port 21
* Trying 212.27.40.252... * connected
* Connected to ftpperso.free.fr (212.27.40.252) port 21
< 220 Serveur de mise a jour des pages perso de Free.fr version [Sep 22 2004 01:22:45]
> USER vivil
< 331 Password required for vivil.
> PASS xxxxxxxxx
< 230 User vivil logged in.
* We have successfully logged in
> PWD
< 257 "/" is current directory.
* Entry path is '/'
> EPSV
< 500 'EPSV': command unrecognized.
> PASV
< 227 Entering Passive Mode (212,27,40,252,34,45).
* Trying 212.27.40.252... * connected
* Connecting to 212.27.40.252 (212.27.40.252) port 8749
* Connected the data stream with PASV!
> TYPE I
< 200 Type set to I
> STOR file1kb
< 150 Opening BINARY mode data connection for file1kb
< 226 Transfer complete.
* Connection #0 to host ftpperso.free.fr left intact
'Weuploaded746bytes
'> QUIT
< 221 Goodbye.
* Closing connection #0
Received on 2004-12-12