Re: Killing a running process
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: Killing a running process

From: Ralf Fassel <ralfixx@gmx.de>
Date: Fri Mar 03 2006 - 17:17:39 CET

* "al-s" <stosh259@hotmail.com>
| How do I kill any running processes on the channel in use without
| making globals?

  pid $channel

gives you the process ids of the processes in the pipe.

Typically you would use this list and attach it to a button, eg.
   set fd [open "|..."]
   set pids [pid $fd]
   button .b -text {Stop} -command [list stop_processes $pids]

You will then have to use a system-dependend means to kill those
processes in 'stop_processes'. On Unix you could use
   exec kill $pid

IIRC TclX also has a kill proc which works on Windows and Unix
   http://wiki.tcl.tk/207
   http://tclx.sf.net/

HTH
R'
Received on Sun Apr 30 02:22:50 2006