...here is a diff for newer 1.11.4 (attached). Hope it is compatible with 1.12 too.
On Mon, Dec 27, 2010 at 6:58 PM, Dmitry Koterov <[email protected]>wrote: > Hello. > > A lot of people use wget as auxillary program to organize robust (and > resumable) background downloading in their programs. > > E.g. I execute wget via system() or exec() in my program and wait for its > termination in the background doing other things in parallel. But if my > program is accidently terminated (e.g. killer or died on unexpected error), > wget process continues to run in the background, and I have no chance to > terminate it, because my program is dead already. > > I added a new feature to wget: "--watchpid=PID" key (works in Windows and > *nix). > > $ wget --watchpid=<my_pid_here> ... > > If specified, this key makes wget to die if the process with > PID=<my_pid_here> is dead. So I may pass parent process PID to wget and be > sure that if my program dies, background downloading will also stop. > > Hope the attached patch will be useful. I'll be happy to see this patch > included to the mainstream. > > >
wget-1.11.4-watchpid.diff
Description: Binary data
