(go to: table of contents, index, list of vms_sys, prev: FORCEX, next: GETJPIW)
FORMAT_ACL - Format Access Control List Entry
Formats the specified access control entry (ACE) into a text string.
Note the difference between an 'access control list' (ACL) and an ACE -
an ACL is comprised by one or more ACEs.
Format:
11-JUL-1999 ZE.
status, aclstr = vms_sys.format_acl
(aclent ,[width] ,[trmdsc] ,[indent] ,[accnam] ,[nullarg])
Returns:
Arguments:
Examples:
$ copy _NLA0: ACL.DAT
$ set ACL ACL.DAT -
/ACL= ( (identifier= [1,4], access= read+write), -
(identifier= [2,4], access= delete+execute), -
(identifier= [3,4], access= control) )
$!
$ directory /acl ACL.DAT
Directory DKA100:[PYTHON.PYTHON-1_5_2.VMS]
ACL.DAT;1
(IDENTIFIER=[G1,SYSTEM],ACCESS=READ+WRITE)
(IDENTIFIER=[2,4],ACCESS=EXECUTE+DELETE)
(IDENTIFIER=[3,4],ACCESS=CONTROL)
Total of 1 file.
$!
----------------------------------------
>>> import pyvms, vms_sys
>>>
>>> fab = pyvms.vmsobj_fab ()
>>> xabpro = pyvms.vmsobj_xabpro ()
>>>
>>> fab.FNA = 'ACL.DAT'
>>> fab.XAB = xabpro
>>>
>>> # allocate a read/write buffer for the ACL
>>> aclbuf = pyvms.vmsobj__membuf (200)
>>> xabpro.ACLBUF = aclbuf
>>>
>>> status = vms_sys.open (fab)
>>> print vms_sys.getmsg (status)
('%RMS-S-NORMAL, normal successful completion', (0, 0, 0, 0))
>>> print vms_sys.getmsg (fab.L_STS)
('%RMS-S-NORMAL, normal successful completion', (0, 0, 0, 0))
>>> # ACL status
>>> print vms_sys.getmsg (xabpro.L_ACLSTS)
('%SYSTEM-S-NORMAL, normal successful completion', (0, 0, 0, 0))
>>>
>>> # 1st ACE
>>> print vms_sys.format_acl (aclbuf.buffer[0:xabpro.W_ACLLEN], \
... 90, '*', 4)
(1, ' (IDENTIFIER=[G1,SYSTEM],ACCESS=READ+WRITE)')
>>> aclsiz = ord (aclbuf.buffer[:1])
>>>
>>> # 2nd ACE
>>> vms_sys.format_acl \
... (aclbuf.buffer[aclsiz:xabpro.W_ACLLEN-aclsiz], \
... 60, '*', 4)
(1, ' (IDENTIFIER=[2,4],ACCESS=EXECUTE+DELETE)')
>>>
>>> # 3rd ACE ignored
>>>
>>> status = vms_sys.close (fab)
>>> print vms_sys.getmsg (status)
('%RMS-S-NORMAL, normal successful completion', (0, 0, 0, 0))
>>>
@@ more vms_sys.format_acl() examples
>>>
(go to: table of contents,
index, list of vms_sys,
prev: FORCEX,
next: GETJPIW)