(go to: table of contents, index, list of VMS objects, prev: vmsobj_xabkey, next: vmsobj_xabrdt)
The 'vms_xabprodef' module contains constants
and bitmasks that apply to an OpenVMS XABPRO.
Most BWLQ,M attributes can be directly read and written as shown in the
introduction. Exceptions are noted below:
However, you must NOT provide a buffer that is bigger than 512 bytes or the
read operation will fail with an SS$_BADATTR@@ error in FAB$L_STV. The ACP-QIO
interface (ATR$C_READACL) that RMS uses is limited to this amount. The XQP
will read as much data as will fit into the buffer, however only complete
ACEs will be stored, so
"xabpro.W_ACLLEN" will very likely be smaller than
"xabpro.W_ACLSIZ" after reading ACEs.
This is shown in the examples section of
vms_sys.format_acl().
If you want to fetch an ACL that is bigger than 512 bytes, you should instead
make a call to vms_sys.get_security().
See the example 'get the entire ACL'
A read operation from this attribute gives a new Python string. Note that
ACLs contain binary information - use something like 'print repr(aclstr)'
to display its contents.
For now the 'pyvms' module contains a function to
explicitly create a vmsobj_xabpro object within Python.
Examples:
Attributes:
>>> xabpro = pyvms.vmsobj_xabpro ()
>>> type (xabpro)
<type 'vmsobj_xabpro'>
>>>
>>> print xabpro.NXT
None
>>> print xabpro.L_NXT
0
>>>
>>> # this example uses a XABALL
>>> xaball = pyvms.vmsobj_xaball ()
>>> type (xaball)
<type 'vmsobj_xaball'>
>>>
>>> xabpro.NXT = xaball
>>> xaball
<vmsobj_xaball, XABALL at 0x00221568>
>>> xabpro.NXT
<vmsobj_xaball, XABALL at 0x00221568>
>>> hex (xabpro.L_NXT)
'0x221568'
>>>
>>> xabpro.NXT = None
>>> print xabpro.NXT
None
>>> xabpro.L_NXT
0
>>>
>>> xabpro.NXT = 0
Traceback (innermost last):
File "<stdin>", line 1, in ?
TypeError: must be a vmsobj_xabXXX object or None
>>>
>>> xabpro.L_NXT = 2
Traceback (innermost last):
File "<stdin>", line 1, in ?
AttributeError: read-only vmsobj_xabpro attribute
>>>
Creation:
>>> import pyvms
>>> # create a vmsobj_xabpro object
>>>
>>> xabpro = pyvms.vmsobj_xabpro ()
>>> type (xabpro)
<type 'vmsobj_xabpro'>
>>> xabpro
<vmsobj_xabpro, XABPRO at 0x00221668>
>>>
>>> # invalid attribute access
>>> xabpro.no_attr = 0
Traceback (innermost last):
File "<stdin>", line 1, in ?
AttributeError: non-existing vmsobj_xabpro attribute
>>> xabpro.no_attr
Traceback (innermost last):
File "<stdin>", line 1, in ?
AttributeError: no_attr
>>>
...
@@