(PYVMS LOGO) Python on OpenVMS

(go to: table of contents, index, list of vms_sys, prev: DELLNM, next: DEVICE_SCAN)


DELPRC - Delete Process


Format:
    targpid = vms_sys.delprc ([pidadr] [,prcnam])
Returns:
targpid
Process identification of process which has been deleted - unless, of course the process has deleted itself ...
The targed PID (targpid) is always returned - it is as if you have specified a '0' value for the 'pidadr' argument. If an error happens, then vms_sys.delprc() raises a Python exception.
Arguments:
pidadr
Process identification of process to be deleted.
prcnam
Process name of process to be deleted.
Examples:
>>> import vms_sys

>>> print vms_sys.delprc ()
(current process is deleted)

>>> print vms_sys.delprc (None,None)
(current process is deleted)

>>> print vms_sys.delprc (353)
353
(target process is deleted + its PID is returned)

$ cmd = "import vms_sys; print 'a'; print 'b'"
$ spawn python -c "''cmd'"
%DCL-S-SPAWNED, process ZESSIN_1 spawned
%DCL-S-ATTACHED, terminal now attached to process ZESSIN_1

a
b
%DCL-S-RETURNED, control returned to process ZESSIN_FTA17
$


$ cmd = "import vms_sys; print 'a'; vms_sys.delprc (); print 'b'"
$ spawn python -c "''cmd'"
%DCL-S-SPAWNED, process ZESSIN_1 spawned
%DCL-S-ATTACHED, terminal now attached to process ZESSIN_1

a
%DCL-S-RETURNED, control returned to process ZESSIN_FTA17
$! --> 'b' is not printed because subprocess is deleted by delprc()


>>> print vms_sys.delprc (0,"TARG_PRC")
355
(target process is deleted + its PID is returned)

>>> print vms_sys.delprc (None,"TARG_PRC")
476
(target process is deleted + its PID is returned)

>>> no_such_pid = 12345
>>> print vms_sys.delprc (no_such_pid)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_sys.error: (2280, '%SYSTEM-W-NONEXPR, nonexistent process')

>>> no_such_prcnam = "NO_PRCNAM"
>>> print vms_sys.delprc (0,no_such_prcnam)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_sys.error: (2280, '%SYSTEM-W-NONEXPR, nonexistent process')

>>> audit_server_pid = 265
>>> print vms_sys.delprc (265)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_sys.error: (9020, '%SYSTEM-F-NODELETE, object cannot be deleted')
>>> # the AUDIT_SERVER process cannot be deleted

(go to: table of contents, index, list of vms_sys, prev: DELLNM, next: DEVICE_SCAN)

27-SEP-1998 ZE.