From: Eduardo M KALINOWSKI

> wget http://www.somehost.com/nonexistant.html -O localfile.html
> 
> then file "localfile.html" will always be created, and will have length
> of zero even if the remote file does not exist.

   Because with "-O", Wget opens the output file before it does any
network activity, and after it's done, it closes the file and leaves it
there, regardless of its content (or lack of content).

   You could avoid "-O", and rename the file after the Wget command. 
You could keep the "-O", and check the status of the Wget command
(and/or check the output file size), and delete the file if it's no
good.  (And probably many other things, as well.)

   If you look through "http://www.mail-archive.com/wget@sunsite.dk/";,
you can find many people who think that "-O" should do something else,
but (for now) it does what it does.

------------------------------------------------------------------------

   Steven M. Schweda               [EMAIL PROTECTED]
   382 South Warwick Street        (+1) 651-699-9818
   Saint Paul  MN  55105-2547

Reply via email to