Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!swrinde!pipex!uunet!halon!sybase!vinay
From: vinay@sybase.com (Vinay Santurkar)
Subject: Terminating a process on user interrupt
Message-ID: <CzzvL5.5JF@sybase.com>
Sender: usenet@sybase.com
Organization: Sybase, Inc.
Distribution: usa
Date: Mon, 28 Nov 1994 20:29:29 GMT
Lines: 37

Hi,


1. I am trying to provide a feature in my application to have users terminate processes. I wrote an exception handler and was hoping to have a mechanism to kill the process in the handler. I haven't been able to get it to work. I'm using the UnixProcess cshOne method to start my Application, and that is part of the problem. This is the code fragment I tried:

-----------------------------------------------------

|p1 terminate msg |


 terminate := false.
 Object userInterruptSignal	" If the user interrupts "
      handle: [:ex |  
			"Set flags to indicate the process needs to be terminated"
			terminate := true. 
			ex proceed 	
	      ]
      do: [
			p1 := [ UnixProcess cshOne: 'myScript'.
	      		      ] fork.
			(terminate = true) ifTrue: [ p1.terminate.]
	
	  ].

------------------------------------------------------

It does not work. Can you suggest how I could be doing it right.

2. Is there a message to generate a BEEP. I wan't to indicate to the 
user the completion of a process, or an invalid key click.

Vinay
-- 
###############################################################

Vinay Santurkar             email:  vinay@sybase.com
Sybase, Inc.                voice:  (510) 922-5206
