Re: -O switch always overwrites output file

2006-05-19 Thread Mauro Tortonesi

Toni Casueps wrote:
I use Wget 1.10 for Linux. If I use -O and there was already a file in 
the current directory with the same name it overwrites it, even if I use 
-nc. Is this a bug or intentional?


IMVHO, this is a bug. if hrvoje does not provide a rationale for this 
behavior, i will fix it before the release of wget 1.11 (which should be 
pretty soon).


--
Aequam memento rebus in arduis servare mentem...

Mauro Tortonesi  http://www.tortonesi.com

University of Ferrara - Dept. of Eng.http://www.ing.unife.it
GNU Wget - HTTP/FTP file retrieval tool  http://www.gnu.org/software/wget
Deep Space 6 - IPv6 for Linuxhttp://www.deepspace6.net
Ferrara Linux User Group http://www.ferrara.linux.it


Re: -O switch always overwrites output file

2006-05-19 Thread Hrvoje Niksic
Mauro Tortonesi [EMAIL PROTECTED] writes:

 Toni Casueps wrote:
 I use Wget 1.10 for Linux. If I use -O and there was already a file
 in the current directory with the same name it overwrites it, even
 if I use -nc. Is this a bug or intentional?

 IMVHO, this is a bug. if hrvoje does not provide a rationale for
 this behavior, i will fix it before the release of wget 1.11 (which
 should be pretty soon).

Overwriting the file without -nc (as opposed to using file.1 and so
on) is intentional -- if you specify the file name, that file name
gets used.

As for -nc, its work is based on the URL.  There can be more than one
URL, and it seems useful to only download the stuff that is actually
needed.  If you really need to download some URL iff the specified
output file doesn't exist, you can always do this:

test -f file || wget -O file ...


Re: -O switch always overwrites output file

2006-05-05 Thread Steven M. Schweda
   Wget 1.10.2 is the current release, but I wouldn't expect a change in
this behavior from the additional 0.0.2.

   The -nc option affects output files whose names are derived
automatically from the URLs involved.  The -nc code currently is not
engaged for the user-specified -O file name, the code for which is in
a different neighborhood.  It may not have been a conscious decision,
but that's the way it works now.

   Personally, I figure that if the user specifies the output file name,
then it's his fault if the program overwrites his (precious) old file,
but I wouldn't complain if someone added a -nc check for the -O
file.



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