[resubmitted to wget@ instead of wget-patches]

> From: Rupert Levene [mailto:[EMAIL PROTECTED]
> 
..
 
> My vote: keep the option for either behaviour :-) As written, the
> patch only changes behaviour if the --timestamping and 
--delete-before
> options are in effect.
> 
> Rupert

I understand that you want that feature for your own special 
needs, on the
other hand there is Hrvoje's (more than reasonable!) desire 
to avoid option
proliferation and creeping featuritis.
So why not a more general option - you could code a 
run-external-command
feature before and after downloading a file, passing a number 
of arguments.
Something like

<command> BEFORE [LOC=location, url] [SAVE_PATH=path where 
the file will be
saved] [REF=possibly referring url] [ORG_SIZE=...] [STARTTIME=] ...

then download, followed by

<command> AFTER SUCCESS|FAILURE [NUM_ATTEMPTS=..]
[ERRTYPE=TIMEOUT|MAX_ATTEMPTS|NOT_RESOLVED] [FINAL_SIZE=] 
[USERTIME=...]
[EFFECTIVETIME=usertime except the retry waiting periods] ...

just as an example of syntax and parameters, probably 
somebody could come up
with a better syntax, possibly some other interesting data could be
gathered. Possibly the data could be passed in the 
environment instead of
arguments (this would avoid the need for getopts or string 
operations for
simple shell scripts).

This would solve a whole lot of wanted features with just one 
option, for
example from time to time somebody wants to know how to get 
an exact list of
downloaded files, currently the log must be parsed or 
something similar.
You would just write a small script in order to unlink the 
SAVE_PATH file
and run wget --run-before=dounlink.pl or whatever.

I suppose for a starter just basic data already available (url, path &
filename, SUCCESS|FAILURE) would contain the amount of work 
needed for this.

Hrvoje, what do you think about this ? Acceptable ? Horrible ?

Heiko

-- 
-- PREVINET S.p.A. www.previnet.it
-- Heiko Herold [EMAIL PROTECTED]
-- +39-041-5907073 ph
-- +39-041-5907472 fax

Reply via email to