Difference between revisions of "VMS-Specific Python Modules"
(→vms.sys) |
|||
Line 1: | Line 1: | ||
VMS specific Python modules. | VMS specific Python modules. | ||
== vms.decc == | == vms.decc == | ||
− | Wraps the ''' | + | Wraps the '''C Run-Time Library for OpenVMS Systems''' functions. |
=== dlopen_test(name:str)->int === | === dlopen_test(name:str)->int === | ||
Line 27: | Line 27: | ||
=== getenv(name:str, def_value:str)->str === | === getenv(name:str, def_value:str)->str === | ||
− | Gets the specified environment variable value. See getenv() description in the ''' | + | Gets the specified environment variable value. See getenv() description in the '''C Run-Time Library Reference Manual for OpenVMS Systems''' documentation. |
==== parameters ==== | ==== parameters ==== | ||
* <code>name:str</code> name of the environment variable | * <code>name:str</code> name of the environment variable | ||
Line 185: | Line 185: | ||
== vms.lib == | == vms.lib == | ||
− | Wraps the ''' | + | Wraps the '''OpenVMS RTL Library(LIB$)''' functions. |
=== create_dir(name:str, uic:int, pe:int, pv:int)->int === | === create_dir(name:str, uic:int, pe:int, pv:int)->int === | ||
Line 194: | Line 194: | ||
** <code>None</code> - the current user | ** <code>None</code> - the current user | ||
** <code>0</code> - owner of the parent directory | ** <code>0</code> - owner of the parent directory | ||
− | * <code>pe:int</code> protection enable. See full documentation in the ''' | + | * <code>pe:int</code> protection enable. See full documentation in the '''OpenVMS RTL Library(LIB$) Manual''' for LIB$CREATE_DIR. |
* <code>pv:int</code> protection value | * <code>pv:int</code> protection value | ||
==== returns ==== | ==== returns ==== | ||
Line 257: | Line 257: | ||
* <code>pid:int</code> process id | * <code>pid:int</code> process id | ||
* <code>pname:str</code> process name | * <code>pname:str</code> process name | ||
− | For valid combination of the values of <code>pid</code> and <code>pname</code> see the ''' | + | For valid combination of the values of <code>pid</code> and <code>pname</code> see the '''OpenVMS RTL Library(LIB$) Manual''' for LIB$GETJPI. The resulting <code>pid</code> is not returned. |
==== returns ==== | ==== returns ==== | ||
The list: | The list: | ||
Line 295: | Line 295: | ||
== vms.sys == | == vms.sys == | ||
− | Wraps the '''OpenVMS System Services'''functions. | + | Wraps the '''OpenVMS System Services''' functions. |
=== asctim(vms_time:int, time_only:int)->list === | === asctim(vms_time:int, time_only:int)->list === | ||
Line 331: | Line 331: | ||
Translates the specified identifier value to the identifier name. | Translates the specified identifier value to the identifier name. | ||
==== parameters ==== | ==== parameters ==== | ||
− | * <code>id_val:int</code> identifier value. See ''' | + | * <code>id_val:int</code> identifier value. See '''OpenVMS System Services Reference Manual''' for SYS$IDTOASC |
* <code>context:int</code> context value used when <code>idtoasc</code> is called repeatedly. Must be initialized with the value 0. | * <code>context:int</code> context value used when <code>idtoasc</code> is called repeatedly. Must be initialized with the value 0. | ||
==== returns ==== | ==== returns ==== | ||
Line 360: | Line 360: | ||
==== parameters ==== | ==== parameters ==== | ||
* <code>channel:int</code> mailbox channel | * <code>channel:int</code> mailbox channel | ||
+ | ==== returns ==== | ||
+ | Status code | ||
+ | |||
+ | === assign(devnam:str, acmode:int, mbxnam:str, flags:int)->list === | ||
+ | Provides a process with an I/O channel. | ||
+ | ==== parameters ==== | ||
+ | * <code>devnam:str</code> name of the device | ||
+ | * <code>acmode:int</code> access mode to be associated with the channel | ||
+ | * <code>mbxnam:str</code> logical name of the mailbox to be associated with the device | ||
+ | * <code>flags:int</code> an optional device-specific argument | ||
+ | ==== returns ==== | ||
+ | The list: | ||
+ | * <code>int</code> status code of the operation | ||
+ | * <code>int</code> resulting channel | ||
+ | |||
+ | === dassgn(channel:int)->int === | ||
+ | Unassigns (releases) an I/O channel. | ||
+ | ==== parameters ==== | ||
+ | * <code>channel:int</code> number of the I/O channel to be unassigned | ||
+ | ==== returns ==== | ||
+ | Status code | ||
+ | |||
+ | === readvblk(channel:int, max_read:int, block:int, fmod:int)->list === | ||
+ | Read from I/O channel. | ||
+ | ==== parameters ==== | ||
+ | * <code>channel:int</code> I/O channel | ||
+ | * <code>max_read:int</code> amount of bytes to read | ||
+ | * <code>block:int</code> starting block | ||
+ | * <code>fmod:int</code> function code modifiers | ||
+ | ==== returns ==== | ||
+ | The list: | ||
+ | * <code>int</code> status code of the operation | ||
+ | * <code>byte</code> resulting buffer | ||
+ | * <code>int</code> I/O completion code | ||
+ | |||
+ | === writevblk(channel:int, buffer:bytes, block:int, fmod:int)->list === | ||
+ | Write to I/O channel. | ||
+ | ==== parameters ==== | ||
+ | * <code>channel:int</code> I/O channel | ||
+ | * <code>buffer:bytes</code> bytes to write | ||
+ | * <code>block:int</code> starting block | ||
+ | * <code>fmod:int</code> function code modifiers | ||
+ | ==== returns ==== | ||
+ | The list: | ||
+ | * <code>int</code> status code of the operation | ||
+ | * <code>int</code> amount of written bytes | ||
+ | * <code>int</code> I/O completion code | ||
+ | |||
+ | === cancel(channel:int)->int === | ||
+ | Cancel I/O operation. | ||
+ | ==== parameters ==== | ||
+ | * <code>channel:int</code> I/O channel | ||
+ | ==== returns ==== | ||
+ | Status code | ||
+ | |||
+ | === crelnm(attr:int, tabnam:str, lognam:str, acmode:int, il:object)->int === | ||
+ | Creates a logical name and specifies its equivalence names. | ||
+ | ==== parameters ==== | ||
+ | * <code>attr:int</code> attributes to be associated with the logical name. See '''vms.lnmdef''' | ||
+ | * <code>tabnam:str</code> name of the table in which to create the logical name | ||
+ | * <code>lognam:str</code> logical name to be created | ||
+ | * <code>acmode:int</code> access mode to be associated with the logical name. See '''vms.psldef''' | ||
+ | * <code>il:object</code> item list, created via <code>vms.ile3.new()</code> | ||
+ | See '''OpenVMS System Services Reference Manual''' for SYS$CRELNM. | ||
==== returns ==== | ==== returns ==== | ||
Status code | Status code | ||
== rdb == | == rdb == |
Revision as of 07:56, 31 August 2020
VMS specific Python modules.
Contents
- 1 vms.decc
- 1.1 dlopen_test(name:str)->int
- 1.2 fix_time(vms_time:int)->int
- 1.3 from_vms(vms_path:str, wild_flag:int)->list
- 1.4 getenv(name:str, def_value:str)->str
- 1.5 sleep(seconds:int)->int
- 1.6 sysconf(name:int)->int
- 1.7 to_vms(unix_path:str, allow_wild:int, no_directory:int)->list
- 1.8 unixtime(vms_time:int)->int
- 1.9 vmstime(unix_time:int)->int
- 2 vms.ile3
- 2.1 new()->object
- 2.2 delete(il:object)->None
- 2.3 size(il:object)->int
- 2.4 addint(il:object, item:int, item_type:int, item_value:int)->None
- 2.5 getint(il:object, index:int)->int
- 2.6 gethex(il:object, index:int)->str
- 2.7 addstr(il:object, item:int, item_value:str, item_length:int)->None
- 2.8 addstrd(il:object, item:int, item_value:str, item_length:int)->None
- 2.9 addstrn(il:object, item:int, item_value:str, item_length:int)->None
- 2.10 getstr(il:object, index:int, flag:int)->str
- 2.11 addbin(il:object, item:int, item_value:int, item_offset:int, item_len:int)->None
- 2.12 getbyte(il:object, index:int, item_offset:int)->int
- 3 vms.lib
- 3.1 create_dir(name:str, uic:int, pe:int, pv:int)->int
- 3.2 date_time()->list
- 3.3 get_ef()->list
- 3.4 free_ef(ef:int)->int
- 3.5 put_common(common:str)->int
- 3.6 get_common()->list
- 3.7 get_hostname(flags:int)->list
- 3.8 getjpi(item_code:int, pid:int, pname:str)->list
- 3.9 getsyi(item_code:int, node_name:str)->list
- 3.10 spawn(command:str, input_file:str, output_file:str, flags:int, pname:str)->list
- 3.11 do_command(command:str)->None
- 4 vms.sys
- 4.1 asctim(vms_time:int, time_only:int)->list
- 4.2 bintim(time_str:str)->list
- 4.3 asctoid(name:str)->list
- 4.4 idtoasc(id_val:int, context:int)->list
- 4.5 crembx(tmp:int, maxmsg:int, bufquo:int, promsk:int, acmode:int, mbx_name:string, flags:int)->list
- 4.6 delmbx(channel:int)->int
- 4.7 assign(devnam:str, acmode:int, mbxnam:str, flags:int)->list
- 4.8 dassgn(channel:int)->int
- 4.9 readvblk(channel:int, max_read:int, block:int, fmod:int)->list
- 4.10 writevblk(channel:int, buffer:bytes, block:int, fmod:int)->list
- 4.11 cancel(channel:int)->int
- 4.12 crelnm(attr:int, tabnam:str, lognam:str, acmode:int, il:object)->int
- 5 rdb
vms.decc
Wraps the C Run-Time Library for OpenVMS Systems functions.
dlopen_test(name:str)->int
Tries to open a shared image.
parameters
name:str
path to the shared image
returns
1
if the shared image exists and can be opened by dlopen()0
otherwise
fix_time(vms_time:int)->int
Converts VMS time to the Unix time.
parameters
vms_time:int
VMS system time
returns
Time in Unix format (seconds that have elapsed since 1970.01.01)
from_vms(vms_path:str, wild_flag:int)->list
Converts VMS path to a list of Unix paths.
parameters
vms_path:str
path in VMS format (supports wildcards)wild_flag:int
If set to0
, wildcards found in thevms_path
are not expanded
returns
List of paths in Unix format
getenv(name:str, def_value:str)->str
Gets the specified environment variable value. See getenv() description in the C Run-Time Library Reference Manual for OpenVMS Systems documentation.
parameters
name:str
name of the environment variabledef_value:str
default value
returns
Environment variable value
sleep(seconds:int)->int
Suspends execution of the current process or thread for the specified number of seconds.
parameters
seconds:int
seconds to sleep
returns
The number of seconds left to the end of the sleep period if sleep is interrupted.
0
if the process slept for the specified number of seconds.
sysconf(name:int)->int
Provides a method for determining the current value of a configurable system limit or whether optional features are supported.
parameters
name:int
system variable to be queried
returns
Requested value
to_vms(unix_path:str, allow_wild:int, no_directory:int)->list
Converts UNIX style file specifications to OpenVMS file specifications.
parameters
unix_path:str
file name in UNIX style file specification formatallow_wild:int
If set to0
, wildcards found inunix_path
are not expandedno_directory:int
An integer that has one of the following values:- 0 - Directory allowed
- 1 - Prevent expansion of the string as a directory name
- 2 - Force expansion of the string as a directory name
returns
List of paths in OpenVMS style
unixtime(vms_time:int)->int
Converts OpenVMS system time to the Unix local time.
parameters
vms_time:int
OpenVMS system time
returns
Unix time
vmstime(unix_time:int)->int
Converts Unix time to the OpenVMS system time.
parameters
unix_time:int
Unix time
returns
OpenVMS system time
vms.ile3
Provides functions for working with the list.
new()->object
Creates empty item list.
parameters
None
returns
New empty item list
delete(il:object)->None
Deletes item list.
parameters
il:object
item list to be removed
returns
OpenVMS system time
size(il:object)->int
Gets size of the item list.
parameters
il:object
item list
returns
The size of the specified item list
addint(il:object, item:int, item_type:int, item_value:int)->None
Adds a new integer to the item list.
parameters
il:object
item listitem:int
item to additem_type:int
type of the item. See vms.dscdefitem_value:int
value of the item
returns
None
getint(il:object, index:int)->int
Gets the integer at the specified index in the list.
parameters
il:object
item listindex:int
index of the item to get
returns
Integer value
gethex(il:object, index:int)->str
Gets the integer at the specified index in the item list and returns it as a hexadecimal string.
parameters
il:object
item listindex:int
index of the item to get
returns
Hexadecimal string
addstr(il:object, item:int, item_value:str, item_length:int)->None
Adds the specified string to the item list. If the item_value
is not None
, the item_length
is ignored and the length of the buffer will be the same as the length of the item_value
.
parameters
il:object
item listitem:int
item to additem_value:str
value to add (orNone
)item_length:int
length of the buffer if theitem_value
isNone
returns
None
addstrd(il:object, item:int, item_value:str, item_length:int)->None
Adds the specified space-expanded string to the item list. The first byte of the buffer is the length of the string. If the item_value
is longer than the item_length
, it will be truncated.
parameters
il:object
item listitem:int
item to additem_value:str
value to additem_length:int
length of the buffer (the resulting string length is one byte less)
returns
None
addstrn(il:object, item:int, item_value:str, item_length:int)->None
Adds the specified space-expanded string to the item list. If the item_value
is longer than the item_length
, it will be truncated.
parameters
il:object
item listitem:int
item to additem_value:str
value to additem_length:int
length of the buffer
returns
None
getstr(il:object, index:int, flag:int)->str
Gets the string at the specified index in the item list.
parameters
il:object
item listindex:int
index of the item to getflag:int
if set to1
, the first byte of the resulting string is the length of the string
returns
String
addbin(il:object, item:int, item_value:int, item_offset:int, item_len:int)->None
Adds a new binary item to the list. It will be interpreted as a string.
parameters
il:object
item listitem:int
item to additem_value:int
value to storeitem_offset:int
starting byteitem_len:int
amount of bytes
returns
None
getbyte(il:object, index:int, item_offset:int)->int
Gets the byte at the specified position in the item list.
parameters
il:object
item listindex:int
index of the itemitem_offset:int
starting byte
returns
Integer value of the specified byte
vms.lib
Wraps the OpenVMS RTL Library(LIB$) functions.
create_dir(name:str, uic:int, pe:int, pv:int)->int
Creates a directory.
parameters
name:str
name of the directory to be created (specified in OpenVMS style)uic:int
unsigned integer value of the owner UIC:None
- the current user0
- owner of the parent directory
pe:int
protection enable. See full documentation in the OpenVMS RTL Library(LIB$) Manual for LIB$CREATE_DIR.pv:int
protection value
returns
vms.ssdef.SS__CREATED
one or more directories createdvms.ssdef.SS__NORMAL
all specified directories already exist- another error. See in vms.ssdef
date_time()->list
Gets current date and time.
parameters
None
returns
The list:
int
status code of the operationstr
resulting string
get_ef()->list
Allocates a local event flag.
parameters
None
returns
The list:
int
status code of the operationint
resulting event flag
free_ef(ef:int)->int
Releases the local event flag.
parameters
ef:int
the local event flag
returns
Status code of the operation
put_common(common:str)->int
Copies a string into the common area.
parameters
common:str
string to copy
returns
Status code of the operation
get_common()->list
Gets the string from the common area.
parameters
None
returns
The list:
int
status code of the operationstr
resulting string
get_hostname(flags:int)->list
Gets the host name of the local system.
parameters
flags:int
if set to1
, the host node name is returned in the parsable form
returns
The list:
int
status code of the operationstr
resulting host node name
getjpi(item_code:int, pid:int, pname:str)->list
Gets the specified job/process information as a string.
parameters
item_code:int
item identifier code defining the item of information to be returned. See vms.jpidefpid:int
process idpname:str
process name
For valid combination of the values of pid
and pname
see the OpenVMS RTL Library(LIB$) Manual for LIB$GETJPI. The resulting pid
is not returned.
returns
The list:
int
status code of the operationstr
resulting string
getsyi(item_code:int, node_name:str)->list
Gets system wide information as a string.
parameters
item_code:int
item identifier code defining the item of information to be returned. See vms.syidefnode_name:str
node name
returns
The list:
int
status code of the operationstr
resulting stringint
resulting cluster system id
spawn(command:str, input_file:str, output_file:str, flags:int, pname:str)->list
Requests the command language interpreter (CLI) of the calling process to spawn a subprocess for executing CLI commands.
parameters
command:str
command to executeinput_file:str
equivalence name to be associated with the logical name SYS$INPUToutput_file:str
equivalence name to be associated with the logical name SYS$OUTPUTflags:int
flag bits that designate optional behavior. See vms.clidefpname:str
name defined for the subprocess
returns
The list:
int
status code of the operationint
process id of the spawned process
do_command(command:str)->None
Stops program execution and directs the command language interpreter (CLI) to execute a command that is supplied as the argument.
parameters
command:str
command to execute
returns
If successful, it does not return control to the calling program.
vms.sys
Wraps the OpenVMS System Services functions.
asctim(vms_time:int, time_only:int)->list
Converts an absolute or delta time from 64-bit system time format to an ASCII string.
parameters
vms_time:int
OpenVMS system time. A negative time value represents a delta time.time_only:int
if set to1
, asctim returns the hour only.
returns
The list:
int
status code of the operationstr
resulting string
bintim(time_str:str)->list
Converts an ASCII string to an absolute or delta time value in the system 64-bit time format.
parameters
time_str:str
in format:- Absolute Time: dd-mmm-yyyy hh:mm:ss.cc
- Delta Time: dddd hh:mm:ss.cc
returns
The list:
int
status code of the operationint
resulting time value
asctoid(name:str)->list
Translates the specified identifier name into its binary identifier value.
parameters
name:str
identifier name
returns
The list:
int
status code of the operationint
resulting identifier valueint
resulting identifier attributes. See vms.kgbdef
idtoasc(id_val:int, context:int)->list
Translates the specified identifier value to the identifier name.
parameters
id_val:int
identifier value. See OpenVMS System Services Reference Manual for SYS$IDTOASCcontext:int
context value used whenidtoasc
is called repeatedly. Must be initialized with the value 0.
returns
The list:
int
status code of the operationstr
resulting identifier nameint
resulting identifier valueint
resulting identifier attributes. See vms.kgbdefint
resulting context
crembx(tmp:int, maxmsg:int, bufquo:int, promsk:int, acmode:int, mbx_name:string, flags:int)->list
Creates a virtual mailbox device.
parameters
tmp:int
the first bit specifies a permanent mailboxmaxmsg:int
maximum size of a message (in bytes)bufquo:int
number of bytes of system dynamic memory that can be used to buffer messages sent to the mailboxpromsk:int
protection mask to be associated with the created mailboxacmode:int
access mode to be associated with the channel to which the mailbox is assignedmbx_name:string
logical name to be assigned to the mailboxflags:int
options for the assign operation. See vms.cmbdef
returns
The list:
int
status code of the operationint
resulting channel
delmbx(channel:int)->int
Marks a permanent mailbox for deletion.
parameters
channel:int
mailbox channel
returns
Status code
assign(devnam:str, acmode:int, mbxnam:str, flags:int)->list
Provides a process with an I/O channel.
parameters
devnam:str
name of the deviceacmode:int
access mode to be associated with the channelmbxnam:str
logical name of the mailbox to be associated with the deviceflags:int
an optional device-specific argument
returns
The list:
int
status code of the operationint
resulting channel
dassgn(channel:int)->int
Unassigns (releases) an I/O channel.
parameters
channel:int
number of the I/O channel to be unassigned
returns
Status code
readvblk(channel:int, max_read:int, block:int, fmod:int)->list
Read from I/O channel.
parameters
channel:int
I/O channelmax_read:int
amount of bytes to readblock:int
starting blockfmod:int
function code modifiers
returns
The list:
int
status code of the operationbyte
resulting bufferint
I/O completion code
writevblk(channel:int, buffer:bytes, block:int, fmod:int)->list
Write to I/O channel.
parameters
channel:int
I/O channelbuffer:bytes
bytes to writeblock:int
starting blockfmod:int
function code modifiers
returns
The list:
int
status code of the operationint
amount of written bytesint
I/O completion code
cancel(channel:int)->int
Cancel I/O operation.
parameters
channel:int
I/O channel
returns
Status code
crelnm(attr:int, tabnam:str, lognam:str, acmode:int, il:object)->int
Creates a logical name and specifies its equivalence names.
parameters
attr:int
attributes to be associated with the logical name. See vms.lnmdeftabnam:str
name of the table in which to create the logical namelognam:str
logical name to be createdacmode:int
access mode to be associated with the logical name. See vms.psldefil:object
item list, created viavms.ile3.new()
See OpenVMS System Services Reference Manual for SYS$CRELNM.
returns
Status code