views:

3363

answers:

4

What's the best way (or tool) on the Windows (Vista) command line to get size and modification time for a file on a remote webserver, without downloading it?

+6  A: 

There is a Win32 port of wget that works decently.

Tomalak
Thanks! "wget -S --spider" did the trick.
Henning
A: 

I'd download PuTTY and run a telnet session on port 80 to the webserver you want

HEAD /resource HTTP/1.1
Host: www.example.com

You could alternatively download Perl and try LWP's HEAD command. Or write your own script.

Vinko Vrsalovic
+4  A: 

On Linux, I often use curl with the --head parameter. It is available for several operating systems, including Windows.

CesarB
Thanks! http://www.gknw.net/mirror/curl/win32/curl-7.19.0-ssl-sspi-zlib-static-bin-w32.zip has a statically linked version for Win32 that worked even better than wget.
Henning
+1  A: 

1) See the headers that come back from a GET request

wget --server-response -O /dev/null http://....

1a) Save the headers that come back from a GET request

wget --server-response -o headers -O /dev/null http://....

2) See the headers that come back from GET HEAD request

wget --server-response --spider http://....

2a) Save the headers that come back from a GET HEAD request

wget --server-response --spider -o headers http://....
  • David
David Bell