[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-wget] [Patch] added new feature "watch for parent process terminati

From: Dmitry Koterov
Subject: [Bug-wget] [Patch] added new feature "watch for parent process termination"
Date: Mon, 27 Dec 2010 18:58:43 +0300


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

$ 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.

Attachment: wget-1.10.2-watchpid.diff
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]