vmsobj_iosb object

(PYVMS LOGO) Python on OpenVMS

(go to: table of contents, index, list of VMS objects, prev: vmsobj_fab, next: vmsobj_nam)

The vmsobj_iosb object is used to provide writeable(!) storage to OpenVMS system routines (like SYS$GETJPIW) that use an IOSB (I/O status block). This is necessary, because a regular Python object must not have its value changed.

A programmer can create multiple, independend vmsobj_iosb objects and use them in parallel.


Attributes:
b0, b1, ... b7
Read/write access to each byte within the IOSB. 'b0' is the first byte at the lowest address in memory. Data type is a Python integer.
w0, w1, w2, w3
Read/write access to each word (16-bit value) within the IOSB. 'w0' is the first word at the lowest address in memory. Data type is a Python integer.
l0, l1
Read/write access to each longword (32-bit value) within the IOSB. 'l0' is the first longword at the lowest address in memory. Data type is a Python integer.
q
Read/write access to the whole IOSB as a quadword (64-bit value). Data type is a Python long integer.
b
Read/write access to the whole IOSB as an 8-item tuple of bytes. Data type of each item is a Python integer.
w
Read/write access to the whole IOSB as a 4-item tuple of words. Data type of each item is a Python integer.
l
Read/write access to the whole IOSB as a 2-item tuple of longwords. Data type of each item is a Python integer.

Creation:

For now the 'pyvms' module contains a function to explicitly create a vmsobj_iosb object within Python. Note that interface routines (e.g. vms_sys.getjpiw) can implicitly create a vmsobj_iosb object!

The routine that allocates a new OpenVMS IOSB does automatically zero its contents.

Examples:

>>> import pyvms

>>> # create a zero-filled iosb
>>>
>>> iosb = pyvms.vmsobj_iosb ()
>>> type (iosb)
<type 'vmsobj_iosb'>
>>> iosb
<vmsobj_iosb, IOSB at 0x00218530>
>>>

>>> iosb.b0
0
>>> iosb.w1
0
>>> iosb.l1
0
>>> iosb.q
0L
>>> iosb.b
(0, 0, 0, 0, 0, 0, 0, 0)
>>> iosb.l
(0, 0)
>>>

>>> iosb.b0 = 1
>>> iosb.w1 = 0x34
>>> iosb.l1 = 0xabcdef
>>>

>>> hex (iosb.b0)
'0x1'
>>> hex (iosb.b1)
'0x0'
>>> hex (iosb.b2)
'0x34'
>>> hex (iosb.b3)
'0x0'
>>> hex (iosb.b4)
'0xef'
>>> hex (iosb.b5)
'0xcd'
>>> hex (iosb.b6)
'0xab'
>>> hex (iosb.b7)
'0x0'
>>> hex (iosb.w0)
'0x1'
>>> hex (iosb.w1)
'0x34'
>>> hex (iosb.w2)
'0xcdef'
>>> hex (iosb.w3)
'0xab'
>>> hex (iosb.l0)
'0x340001'
>>> hex (iosb.l1)
'0xabcdef'
>>> hex (iosb.q )
'0xABCDEF00340001L'
>>>

>>> iosb.b
(1, 0, 52, 0, 239, 205, 171, 0)
>>> iosb.w
(1, 52, 52719, 171)
>>> iosb.l
(3407873, 11259375)
>>> iosb.q
48358647401807873L
>>>


>>> iosb.b0 = 'X'
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: vms__cvt_py2bin(): data of item must be integer
>>>
>>> iosb.no_attr = 0
Traceback (innermost last):
  File "<stdin>", line 1, in ?
AttributeError: non-existing vmsobj_iosb attribute
>>>
>>> iosb.no_attr
Traceback (innermost last):
  File "<stdin>", line 1, in ?
AttributeError: no_attr
>>>
... @@
(go to: table of contents, index, list of VMS objects, prev: vmsobj_fab, next: vmsobj_nam)

10-FEB-1999 ZE.