bugGNU Wget - Bugs: bug #29027, when http 404 error occurs wget...

 
 

bug #29027: when http 404 error occurs wget saves zero-size file with -O

Submitted by:  None
Submitted on:  Sun 28 Feb 2010 04:38:56 PM UTC  
 
Category: Feature RequestSeverity: 1 - Wish
Priority: 5 - NormalStatus: Works For Me
Privacy: PublicAssigned to: Giuseppe Scrivano <gscrivano>
Originator Name: AlexanderOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 1.11.4
Operating System: GNU/LinuxReproducibility: Every Time
Fixed Release: NonePlanned Release: None
Regression: NoneWork Required: None
Patch Included: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 09 Apr 2010 01:23:56 PM UTC, comment #1:

From the documentation:

‘-O file’
‘--output-document=file’
The documents will not be written to the appropriate files, but all will be concatenated together and written to file. If ‘-’ is used as file, documents will be printed to standard output, disabling link conversion. (Use ‘./-’ to print to a file literally named ‘-’.)
Use of ‘-O’ is not intended to mean simply “use the name file instead of the one in the URL;” rather, it is analogous to shell redirection: ‘wget -O file http://foo’ is intended to work like ‘wget -O - http://foo > file’; file will be truncated immediately, and all downloaded content will be written there.

For this reason, ‘-N’ (for timestamp-checking) is not supported in combination with ‘-O’: since file is always newly created, it will always have a very new timestamp. A warning will be issued if this combination is used.

Similarly, using ‘-r’ or ‘-p’ with ‘-O’ may not work as you expect: Wget won't just download the first file to file and then download the rest to their normal names: all downloaded content will be placed in file. This was disabled in version 1.11, but has been reinstated (with a warning) in 1.11.2, as there are some cases where this behavior can actually have some use.

Note that a combination with ‘-k’ is only permitted when downloading a single document, as in that case it will just convert all relative URIs to external ones; ‘-k’ makes no sense for multiple URIs when they're all being downloaded to a single file.

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

The program is behaving according to the documentation ("since file is always newly created"). This also means that an existing file will always be truncated. Unless we get a buy-in from most of the users I don't see any easy way to change this short of adding a new option.

At best this call should be reclassified as a wish list item.

Joe Powers <jpowers>
Sun 28 Feb 2010 04:38:56 PM UTC, original submission:

Steps to reproduce:
$ wget http://gogle.com/foobar
nothing is saved.

But after
$ wget http://gogle.com/foobar -O foo.bar
"foo.bar" file apears in the current directory:
$ ls -l
-rw-r--r-- 1 lxandr lxandr 0 2010-02-28 18:29 foo.bar

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 9.10
Release: 9.10
Codename: karmic

$ uname -a
Linux sledgehammer 2.6.31-20-generic #57-Ubuntu SMP Mon Feb 8 09:02:26 UTC 2010 x86_64 GNU/Linux

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by gscrivano (Updated the item)
  • -unavailable- added by jpowers (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 26 Jul 2010 04:55:41 PM UTCgscrivanoAssigned toNone=>gscrivano
      Open/ClosedOpen=>Closed
    Mon 26 Jul 2010 04:55:40 PM UTCgscrivanoStatusNone=>Works For Me
    Fri 28 May 2010 08:47:34 AM UTCgscrivanoCategoryProgram Logic=>Feature Request
      Severity3 - Normal=>1 - Wish

    Back to the top


    Powered by Savane 3.1-cleanup1