"{ Package: 'stx:libbasic' }"
Object subclass:#OSProcess
instanceVariableNames:'pid parentPid commandLine'
classVariableNames:''
poolDictionaries:''
category:'System-Support'
!
!OSProcess class methodsFor:'documentation'!
documentation
"
OSProcess is an abstract class. Instances represent operating system processes
(as opposed to Smalltalk processes).
[author:]
Stefan Vogel (stefan@zwerg)
[instance variables:]
pid SmallInteger the process id
parentPid SmallInteger the process id of the parent process
commandLine String the command line of the running command.
[class variables:]
[see also:]
Process
"
! !
!OSProcess methodsFor:'accessing'!
commandLine
^ commandLine
!
commandLine:something
commandLine := something.
!
parentPid
^ parentPid
!
parentPid:something
parentPid := something.
!
pid
^ pid
!
pid:something
pid := something.
! !
!OSProcess methodsFor:'printing'!
printOn:aStream
aStream
nextPutAll:self className;
nextPut:$(.
pid printOn:aStream.
aStream space.
commandLine printOn:aStream.
aStream nextPut:$)
! !
!OSProcess methodsFor:'queries'!
getProcessHandle
"some OperatingSystems redefine this to resolve this to a processHandle
(which must be explicitely freed later).
Others simply return the pid here"
^ self subclassResponsibility
!
isAlive
"answer true, if the process is still alive"
^ self subclassResponsibility
!
isDead
"answer true, if the process is no longer alive"
^ self isAlive not
! !
!OSProcess methodsFor:'terminating'!
kill
"kill the process - the process does not get the chance to clean up"
^ self subclassResponsibility.
!
killGroup
"killl the processGroup - the processes does not get the chance to clean up"
^ self subclassResponsibility.
!
killWithAllChildren
"terminate gracefully the process with all of its child processes"
^ self subclassResponsibility.
!
terminate
"terminate the process gracefully"
^ self subclassResponsibility.
!
terminateGroup
"terminate the process group.
Under Windows, these is the same as terminateWithhAllChildren,
under unix, this terminates a subset of all children"
^ self subclassResponsibility.
!
terminateWithAllChildren
"terminate gracefully the process with all of its child processes"
^ self subclassResponsibility.
! !
!OSProcess class methodsFor:'documentation'!
version_CVS
^ '$Header: /cvs/stx/stx/libbasic/OSProcess.st,v 1.2 2011-03-08 17:01:30 stefan Exp $'
! !