Question / Suggestion for wget

2006-10-13 Thread Mitch Silverstein

If -O output file and -N are both specified, it seems like there should be some 
mode where
the tests for noclobber apply to the output file, not the filename that exists 
on the remote machine.

So, if I run
# wget -N http://www.gnu.org/graphics/gnu-head-banner.png -O foo
and then
# wget -N http://www.gnu.org/graphics/gnu-head-banner.png -O foo
the second wget would not clobber and re-get the file.

Similarly, it seems odd that
# wget http://www.gnu.org/graphics/gnu-head-banner.png
and then
# wget -N http://www.gnu.org/graphics/gnu-head-banner.png -O foo
refuses to write the file named foo.

I realize there are already lots of options and the interactions can be pretty 
confusing, but I think
what I'm asking for would be of general usefulness. Maybe I'm sadistic, but -NO 
amuses me as a why to
turn on this behavior. Perhaps just --no-clobber-output-document would be saner.

Thanks for your consideration,
Mitch





Re: Question / Suggestion for wget

2006-10-13 Thread Steven M. Schweda
From: Mitch Silverstein

 If -O output file and -N are both specified [...]

   When -O foo is specified, it's not a suggestion for a file name to
be used later if needed.  Instead, wget opens the output file (foo)
before it does anything else.  Thus, it's always a newly created file,
and hence tends to be newer than any any file existing on any server
(whose date-time is set correctly).

   -O has its uses, but it makes no sense to combine it with -N. 
Remember, too, that wget allows more than one URL to be specified on a
command line, so multiple URLs may be associated with a single -O
output file.  What sense does -N make then?

   It might make some sense to create some positional option which would
allow a URL-specific output file, like, say, -OO, to be used so:

  wget http://a.b.c/d.e -OO not_dd.e http://g.h.i/j.k -OO not_j.k

but I don't know if the existing command-line parser could handle that. 
Alternatively, some other notation could be adopted, like, say,
file=URL, to be used so:

  wget not_dd.e=http://a.b.c/d.e not_j.k=http://g.h.i/j.k

   But that's not what -O does, and that's why you're (or your
expectations are) doomed.



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