VMS-Specific Python Modules: Difference between revisions
No edit summary |
|||
| Line 1: | Line 1: | ||
VMS specific Python modules. | VMS specific Python modules. | ||
== vms.decc == | == vms.decc == | ||
Wraps the '''C Run-Time Library for OpenVMS Systems''' functions. | <br>Wraps the '''C Run-Time Library for OpenVMS Systems''' functions.<br> | ||
---- | |||
=== dlopen_test(name:str)->int === | === dlopen_test(name:str)->int === | ||
Tries to open a shared image. | Tries to open a shared image. | ||
;parameters | ;parameters | ||
: <code>name:str</code> path to the shared image | : <code>name:str</code> path to the shared image | ||
| Line 10: | Line 10: | ||
: <code>1</code> if the shared image exists and can be opened by dlopen() | : <code>1</code> if the shared image exists and can be opened by dlopen() | ||
: <code>0</code> otherwise | : <code>0</code> otherwise | ||
---- | |||
=== fix_time(vms_time:int)->int === | === fix_time(vms_time:int)->int === | ||
Converts VMS time to the Unix time. | Converts VMS time to the Unix time. | ||
;parameters | |||
: <code>vms_time:int</code> VMS system time | |||
;returns | |||
Time in Unix format (seconds that have elapsed since 1970.01.01) | :Time in Unix format (seconds that have elapsed since 1970.01.01) | ||
---- | |||
=== from_vms(vms_path:str, wild_flag:int)->list === | === from_vms(vms_path:str, wild_flag:int)->list === | ||
Converts VMS path to a list of Unix paths. | Converts VMS path to a list of Unix paths. | ||
;parameters | |||
: <code>vms_path:str</code> path in VMS format (supports wildcards) | |||
: <code>wild_flag:int</code> If set to <code>0</code>, wildcards found in the <code>vms_path</code> are not expanded | |||
;returns | |||
List of paths in Unix format | :List of paths in Unix format | ||
---- | |||
=== 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 '''C Run-Time Library Reference Manual for OpenVMS Systems''' documentation. | Gets the specified environment variable value. See getenv() description in the '''C Run-Time Library Reference Manual for OpenVMS Systems''' documentation. | ||
;parameters | |||
: <code>name:str</code> name of the environment variable | |||
: <code>def_value:str</code> default value | |||
;returns | |||
Environment variable value | :Environment variable value | ||
---- | |||
=== sleep(seconds:int)->int === | === sleep(seconds:int)->int === | ||
Suspends execution of the current process or thread for the specified number of seconds. | Suspends execution of the current process or thread for the specified number of seconds. | ||
;parameters | |||
: <code>seconds:int</code> seconds to sleep | |||
;returns | |||
The number of seconds left to the end of the sleep period if sleep is interrupted. | :The number of seconds left to the end of the sleep period if sleep is interrupted. <code>0</code> if the process slept for the specified number of seconds. | ||
<code>0</code> if the process slept for the specified number of seconds. | ---- | ||
=== sysconf(name:int)->int === | === sysconf(name:int)->int === | ||
Provides a method for determining the current value of a configurable system limit or whether optional features are supported. | Provides a method for determining the current value of a configurable system limit or whether optional features are supported. | ||
;parameters | |||
: <code>name:int</code> system variable to be queried | |||
;returns | |||
Requested value | :Requested value | ||
---- | |||
=== to_vms(unix_path:str, allow_wild:int, no_directory:int)->list === | === to_vms(unix_path:str, allow_wild:int, no_directory:int)->list === | ||
Converts UNIX style file specifications to OpenVMS file specifications. | Converts UNIX style file specifications to OpenVMS file specifications. | ||
;parameters | |||
: <code>unix_path:str</code> file name in UNIX style file specification format | |||
: <code>allow_wild:int</code> If set to <code>0</code>, wildcards found in <code>unix_path</code> are not expanded | |||
: <code>no_directory:int</code> 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 | List of paths in OpenVMS style | ||
---- | |||
=== unixtime(vms_time:int)->int === | === unixtime(vms_time:int)->int === | ||
Converts OpenVMS system time to the Unix local time. | Converts OpenVMS system time to the Unix local time. | ||
;parameters | |||
: <code>vms_time:int</code> OpenVMS system time | |||
;returns | |||
Unix time | :Unix time | ||
---- | |||
=== vmstime(unix_time:int)->int === | === vmstime(unix_time:int)->int === | ||
Converts Unix time to the OpenVMS system time. | Converts Unix time to the OpenVMS system time. | ||
;parameters | |||
: <code>unix_time:int</code> Unix time | |||
;returns | |||
OpenVMS system time | OpenVMS system time | ||
---- | |||
== vms.ile3 == | == vms.ile3 == | ||
Provides functions for working with the list. | <br>Provides functions for working with the list.<br> | ||
---- | |||
=== new()->object === | === new()->object === | ||
Creates empty item list. | Creates empty item list. | ||
;parameters | |||
<code>None</code> | :<code>None</code> | ||
;returns | |||
New empty item list | :New empty item list | ||
---- | |||
=== delete(il:object)->None === | === delete(il:object)->None === | ||
Deletes item list. | Deletes item list. | ||
;parameters | |||
: <code>il:object</code> item list to be removed | |||
;returns | |||
OpenVMS system time | :OpenVMS system time | ||
---- | |||
=== size(il:object)->int === | === size(il:object)->int === | ||
Gets size of the item list. | Gets size of the item list. | ||
;parameters | |||
: <code>il:object</code> item list | |||
;returns | |||
The size of the specified item list | :The size of the specified item list | ||
---- | |||
=== addint(il:object, item:int, item_type:int, item_value:int)->None === | === addint(il:object, item:int, item_type:int, item_value:int)->None === | ||
Adds a new integer to the item list. | Adds a new integer to the item list. | ||
;parameters | |||
: <code>il:object</code> item list | |||
: <code>item:int</code> item to add | |||
: <code>item_type:int</code> type of the item. See '''vms.dscdef''' | |||
: <code>item_value:int</code> value of the item | |||
;returns | |||
<code>None</code> | :<code>None</code> | ||
---- | |||
=== getint(il:object, index:int)->int === | === getint(il:object, index:int)->int === | ||
Gets the integer at the specified index in the list. | Gets the integer at the specified index in the list. | ||
;parameters | |||
: <code>il:object</code> item list | |||
: <code>index:int</code> index of the item to get | |||
;returns | |||
Integer value | :Integer value | ||
---- | |||
=== gethex(il:object, index:int)->str === | === gethex(il:object, index:int)->str === | ||
Gets the integer at the specified index in the item list and returns it as a hexadecimal string. | Gets the integer at the specified index in the item list and returns it as a hexadecimal string. | ||
;parameters | |||
: <code>il:object</code> item list | |||
: <code>index:int</code> index of the item to get | |||
;returns | |||
Hexadecimal string | :Hexadecimal string | ||
---- | |||
=== addstr(il:object, item:int, item_value:str, item_length:int)->None === | === addstr(il:object, item:int, item_value:str, item_length:int)->None === | ||
Adds the specified string to the item list. If the <code>item_value</code> is not <code>None</code>, the <code>item_length</code> is ignored and the length of the buffer will be the same as the length of the <code>item_value</code>. | Adds the specified string to the item list. If the <code>item_value</code> is not <code>None</code>, the <code>item_length</code> is ignored and the length of the buffer will be the same as the length of the <code>item_value</code>. | ||
;parameters | |||
: <code>il:object</code> item list | |||
: <code>item:int</code> item to add | |||
: <code>item_value:str</code> value to add (or <code>None</code>) | |||
: <code>item_length:int</code> length of the buffer if the <code>item_value</code> is <code>None</code> | |||
;returns | |||
<code>None</code> | :<code>None</code> | ||
---- | |||
=== addstrd(il:object, item:int, item_value:str, item_length:int)->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 <code>item_value</code> is longer than the <code>item_length</code>, it will be truncated. | Adds the specified space-expanded string to the item list. The first byte of the buffer is the length of the string. If the <code>item_value</code> is longer than the <code>item_length</code>, it will be truncated. | ||
;parameters | |||
: <code>il:object</code> item list | |||
: <code>item:int</code> item to add | |||
: <code>item_value:str</code> value to add | |||
: <code>item_length:int</code> length of the buffer (the resulting string length is one byte less) | |||
;returns | |||
<code>None</code> | :<code>None</code> | ||
---- | |||
=== addstrn(il:object, item:int, item_value:str, item_length:int)->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 <code>item_value</code> is longer than the <code>item_length</code>, it will be truncated. | Adds the specified space-expanded string to the item list. If the <code>item_value</code> is longer than the <code>item_length</code>, it will be truncated. | ||
;parameters | |||
: <code>il:object</code> item list | |||
: <code>item:int</code> item to add | |||
: <code>item_value:str</code> value to add | |||
: <code>item_length:int</code> length of the buffer | |||
;returns | |||
<code>None</code> | :<code>None</code> | ||
---- | |||
=== getstr(il:object, index:int, flag:int)->str === | === getstr(il:object, index:int, flag:int)->str === | ||
Gets the string at the specified index in the item list. | Gets the string at the specified index in the item list. | ||
;parameters | |||
: <code>il:object</code> item list | |||
: <code>index:int</code> index of the item to get | |||
: <code>flag:int</code> if set to <code>1</code>, the first byte of the resulting string is the length of the string | |||
;returns | |||
String | :String | ||
---- | |||
=== addbin(il:object, item:int, item_value:int, item_offset:int, item_len:int)->None === | === 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. | Adds a new binary item to the list. It will be interpreted as a string. | ||
;parameters | |||
: <code>il:object</code> item list | |||
: <code>item:int</code> item to add | |||
: <code>item_value:int</code> value to store | |||
: <code>item_offset:int</code> starting byte | |||
: <code>item_len:int</code> amount of bytes | |||
;returns | |||
<code>None</code> | :<code>None</code> | ||
---- | |||
=== getbyte(il:object, index:int, item_offset:int)->int === | === getbyte(il:object, index:int, item_offset:int)->int === | ||
Gets the byte at the specified position in the item list. | Gets the byte at the specified position in the item list. | ||
;parameters | |||
: <code>il:object</code> item list | |||
: <code>index:int</code> index of the item | |||
: <code>item_offset:int</code> starting byte | |||
;returns | |||
Integer value of the specified byte | :Integer value of the specified byte | ||
---- | |||
== vms.lib == | == vms.lib == | ||
Wraps the '''OpenVMS RTL Library(LIB$)''' functions. | <br>Wraps the '''OpenVMS RTL Library(LIB$)''' functions.<br> | ||
---- | |||
=== create_dir(name:str, uic:int, pe:int, pv:int)->int === | === create_dir(name:str, uic:int, pe:int, pv:int)->int === | ||
Creates a directory. | Creates a directory. | ||
;parameters | |||
: <code>name:str</code> name of the directory to be created (specified in OpenVMS style) | |||
: <code>uic:int</code> unsigned integer value of the owner UIC: | |||
:*<code>None</code> - the current user | |||
:*<code>0</code> - owner of the parent directory | |||
: <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 | |||
;returns | |||
: <code>vms.ssdef.SS__CREATED</code> one or more directories created | |||
: <code>vms.ssdef.SS__NORMAL</code> all specified directories already exist | |||
: another error. See in '''vms.ssdef''' | |||
---- | |||
=== date_time()->list === | === date_time()->list === | ||
Gets current date and time. | Gets current date and time. | ||
;parameters | |||
<code>None</code> | :<code>None</code> | ||
;returns | |||
The list: | :The list: | ||
* <code>int</code> status code of the operation | :*<code>int</code> status code of the operation | ||
* <code>str</code> resulting string | :*<code>str</code> resulting string | ||
---- | |||
=== get_ef()->list === | === get_ef()->list === | ||
Allocates a local event flag. | Allocates a local event flag. | ||
;parameters | |||
<code>None</code> | :<code>None</code> | ||
;returns | |||
The list: | :The list: | ||
* <code>int</code> status code of the operation | :*<code>int</code> status code of the operation | ||
* <code>int</code> resulting event flag | :*<code>int</code> resulting event flag | ||
---- | |||
=== free_ef(ef:int)->int === | === free_ef(ef:int)->int === | ||
Releases the local event flag. | Releases the local event flag. | ||
;parameters | |||
: <code>ef:int</code> the local event flag | |||
;returns | |||
Status code of the operation | :Status code of the operation | ||
---- | |||
=== put_common(common:str)->int === | === put_common(common:str)->int === | ||
Copies a string into the common area. | Copies a string into the common area. | ||
;parameters | |||
: <code>common:str</code> string to copy | |||
;returns | |||
Status code of the operation | :Status code of the operation | ||
---- | |||
=== get_common()->list === | === get_common()->list === | ||
Gets the string from the common area. | Gets the string from the common area. | ||
;parameters | |||
<code>None</code> | :<code>None</code> | ||
;returns | |||
The list: | :The list: | ||
* <code>int</code> status code of the operation | :*<code>int</code> status code of the operation | ||
* <code>str</code> resulting string | :*<code>str</code> resulting string | ||
---- | |||
=== get_hostname(flags:int)->list === | === get_hostname(flags:int)->list === | ||
Gets the host name of the local system. | Gets the host name of the local system. | ||
;parameters | |||
: <code>flags:int</code> if set to <code>1</code>, the host node name is returned in the parsable form | |||
;returns | |||
The list: | :The list: | ||
* <code>int</code> status code of the operation | :*<code>int</code> status code of the operation | ||
* <code>str</code> resulting host node name | :*<code>str</code> resulting host node name | ||
---- | |||
=== getjpi(item_code:int, pid:int, pname:str)->list === | === getjpi(item_code:int, pid:int, pname:str)->list === | ||
Gets the specified job/process information as a string. | Gets the specified job/process information as a string. | ||
;parameters | |||
: <code>item_code:int</code> item identifier code defining the item of information to be returned. See '''vms.jpidef''' | |||
: <code>pid:int</code> process id | |||
: <code>pname:str</code> process name | |||
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. | 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 | |||
The list: | :The list: | ||
* <code>int</code> status code of the operation | :*<code>int</code> status code of the operation | ||
* <code>str</code> resulting string | :*<code>str</code> resulting string | ||
---- | |||
=== getsyi(item_code:int, node_name:str)->list === | === getsyi(item_code:int, node_name:str)->list === | ||
Gets system wide information as a string. | Gets system wide information as a string. | ||
;parameters | |||
: <code>item_code:int</code> item identifier code defining the item of information to be returned. See '''vms.syidef''' | |||
: <code>node_name:str</code> node name | |||
;returns | |||
The list: | :The list: | ||
* <code>int</code> status code of the operation | :*<code>int</code> status code of the operation | ||
* <code>str</code> resulting string | :*<code>str</code> resulting string | ||
* <code>int</code> resulting cluster system id | :*<code>int</code> resulting cluster system id | ||
---- | |||
=== spawn(command:str, input_file:str, output_file:str, flags:int, pname:str)->list === | === 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. | Requests the command language interpreter (CLI) of the calling process to spawn a subprocess for executing CLI commands. | ||
;parameters | |||
: <code>command:str</code> command to execute | |||
: <code>input_file:str</code> equivalence name to be associated with the logical name SYS$INPUT | |||
: <code>output_file:str</code> equivalence name to be associated with the logical name SYS$OUTPUT | |||
: <code>flags:int</code> flag bits that designate optional behavior. See '''vms.clidef''' | |||
: <code>pname:str</code> name defined for the subprocess | |||
;returns | |||
The list: | :The list: | ||
* <code>int</code> status code of the operation | :*<code>int</code> status code of the operation | ||
* <code>int</code> process id of the spawned process | :*<code>int</code> process id of the spawned process | ||
---- | |||
=== do_command(command:str)->None === | === 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. | Stops program execution and directs the command language interpreter (CLI) to execute a command that is supplied as the argument. | ||
;parameters | |||
: <code>command:str</code> command to execute | |||
;returns | |||
If successful, it does not return control to the calling program. | :If successful, it does not return control to the calling program. | ||
---- | |||
== vms.sys == | == vms.sys == | ||
Wraps the '''OpenVMS System Services''' functions. | <br>Wraps the '''OpenVMS System Services''' functions.<br> | ||
---- | |||
=== asctim(vms_time:int, time_only:int)->list === | === asctim(vms_time:int, time_only:int)->list === | ||
Converts an absolute or delta time from 64-bit system time format to an ASCII string. | Converts an absolute or delta time from 64-bit system time format to an ASCII string. | ||
;parameters | |||
: <code>vms_time:int</code> OpenVMS system time. A negative time value represents a delta time. | |||
: <code>time_only:int</code> if set to <code>1</code>, asctim returns the hour only. | |||
;returns | |||
The list: | :The list: | ||
* <code>int</code> status code of the operation | :*<code>int</code> status code of the operation | ||
* <code>str</code> resulting string | :*<code>str</code> resulting string | ||
---- | |||
=== bintim(time_str:str)->list === | === bintim(time_str:str)->list === | ||
Converts an ASCII string to an absolute or delta time value in the system 64-bit time format. | Converts an ASCII string to an absolute or delta time value in the system 64-bit time format. | ||
;parameters | |||
: <code>time_str:str</code> in format: | |||
:* Absolute Time: dd-mmm-yyyy hh:mm:ss.cc | |||
:* Delta Time: dddd hh:mm:ss.cc | |||
;returns | |||
The list: | :The list: | ||
* <code>int</code> status code of the operation | :* <code>int</code> status code of the operation | ||
* <code>int</code> resulting time value | :* <code>int</code> resulting time value | ||
---- | |||
=== asctoid(name:str)->list === | === asctoid(name:str)->list === | ||
Translates the specified identifier name into its binary identifier value. | Translates the specified identifier name into its binary identifier value. | ||
;parameters | |||
: <code>name:str</code> identifier name | |||
;returns | |||
The list: | :The list: | ||
* <code>int</code> status code of the operation | :* <code>int</code> status code of the operation | ||
* <code>int</code> resulting identifier value | :* <code>int</code> resulting identifier value | ||
* <code>int</code> resulting identifier attributes. See '''vms.kgbdef''' | :* <code>int</code> resulting identifier attributes. See '''vms.kgbdef''' | ||
---- | |||
=== idtoasc(id_val:int, context:int)->list === | === idtoasc(id_val:int, context:int)->list === | ||
Translates the specified identifier value to the identifier name. | Translates the specified identifier value to the identifier name. | ||
;parameters | |||
: <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. | |||
;returns | |||
The list: | :The list: | ||
* <code>int</code> status code of the operation | :* <code>int</code> status code of the operation | ||
* <code>str</code> resulting identifier name | :* <code>str</code> resulting identifier name | ||
* <code>int</code> resulting identifier value | :* <code>int</code> resulting identifier value | ||
* <code>int</code> resulting identifier attributes. See '''vms.kgbdef''' | :* <code>int</code> resulting identifier attributes. See '''vms.kgbdef''' | ||
* <code>int</code> resulting context | :* <code>int</code> resulting context | ||
---- | |||
=== crembx(tmp:int, maxmsg:int, bufquo:int, promsk:int, acmode:int, mbx_name:string, flags:int)->list === | === crembx(tmp:int, maxmsg:int, bufquo:int, promsk:int, acmode:int, mbx_name:string, flags:int)->list === | ||
Creates a virtual mailbox device. | Creates a virtual mailbox device. | ||
;parameters | |||
: <code>tmp:int</code> the first bit specifies a permanent mailbox | |||
: <code>maxmsg:int</code> maximum size of a message (in bytes) | |||
: <code>bufquo:int</code> number of bytes of system dynamic memory that can be used to buffer messages sent to the mailbox | |||
: <code>promsk:int</code> protection mask to be associated with the created mailbox | |||
: <code>acmode:int</code> access mode to be associated with the channel to which the mailbox is assigned | |||
: <code>mbx_name:string</code> logical name to be assigned to the mailbox | |||
: <code>flags:int</code> options for the assign operation. See '''vms.cmbdef''' | |||
;returns | |||
The list: | :The list: | ||
* <code>int</code> status code of the operation | :* <code>int</code> status code of the operation | ||
* <code>int</code> resulting channel | :* <code>int</code> resulting channel | ||
---- | |||
=== delmbx(channel:int)->int === | === delmbx(channel:int)->int === | ||
Marks a permanent mailbox for deletion. | Marks a permanent mailbox for deletion. | ||
;parameters | |||
: <code>channel:int</code> mailbox channel | |||
;returns | |||
Status code | :Status code | ||
---- | |||
=== assign(devnam:str, acmode:int, mbxnam:str, flags:int)->list === | === assign(devnam:str, acmode:int, mbxnam:str, flags:int)->list === | ||
Provides a process with an I/O channel. | 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: | :The list: | ||
* <code>int</code> status code of the operation | :* <code>int</code> status code of the operation | ||
* <code>int</code> resulting channel | :* <code>int</code> resulting channel | ||
---- | |||
=== dassgn(channel:int)->int === | === dassgn(channel:int)->int === | ||
Unassigns (releases) an I/O channel. | Unassigns (releases) an I/O channel. | ||
;parameters | |||
: <code>channel:int</code> number of the I/O channel to be unassigned | |||
;returns | |||
Status code | :Status code | ||
---- | |||
=== readvblk(channel:int, max_read:int, block:int, fmod:int)->list === | === readvblk(channel:int, max_read:int, block:int, fmod:int)->list === | ||
Read from I/O channel. | 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: | :The list: | ||
* <code>int</code> status code of the operation | :* <code>int</code> status code of the operation | ||
* <code>byte</code> resulting buffer | :* <code>byte</code> resulting buffer | ||
* <code>int</code> I/O completion code | :* <code>int</code> I/O completion code | ||
---- | |||
=== writevblk(channel:int, buffer:bytes, block:int, fmod:int)->list === | === writevblk(channel:int, buffer:bytes, block:int, fmod:int)->list === | ||
Write to I/O channel. | 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: | :The list: | ||
* <code>int</code> status code of the operation | :* <code>int</code> status code of the operation | ||
* <code>int</code> amount of written bytes | :* <code>int</code> amount of written bytes | ||
* <code>int</code> I/O completion code | :* <code>int</code> I/O completion code | ||
---- | |||
=== cancel(channel:int)->int === | === cancel(channel:int)->int === | ||
Cancel I/O operation. | Cancel I/O operation. | ||
;parameters | |||
: <code>channel:int</code> I/O channel | |||
;returns | |||
Status code | :Status code | ||
---- | |||
=== crelnm(attr:int, tabnam:str, lognam:str, acmode:int, il:object)->int === | === crelnm(attr:int, tabnam:str, lognam:str, acmode:int, il:object)->int === | ||
Creates a logical name and specifies its equivalence names. | 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 [[VMS specific Python modules#new()->object|<code>vms.ile3.new()</code>]] | |||
See '''OpenVMS System Services Reference Manual''' for SYS$CRELNM. | See '''OpenVMS System Services Reference Manual''' for SYS$CRELNM. | ||
;returns | |||
Status code | :Status code | ||
---- | |||
=== trnlnm(attr:int, tabnam:str, lognam:str, acmode:int, il:object)->int === | === trnlnm(attr:int, tabnam:str, lognam:str, acmode:int, il:object)->int === | ||
Returns information about the specified logical name. | Returns information about the specified logical name. | ||
;parameters | |||
: <code>attr:int</code> attributes controlling the search for the logical name. See '''vms.lnmdef''' | |||
: <code>tabnam:str</code> name of the logical name table or the name of a searchlist logical name | |||
: <code>lognam:str</code> logical name for which information is to be returned | |||
: <code>acmode:int</code> access mode to be used in the translation. See '''vms.psldef''' | |||
: <code>il:object</code> item list, created via [[VMS specific Python modules#new()->object|<code>vms.ile3.new()</code>]] | |||
See '''OpenVMS System Services Reference Manual''' for SYS$TRNLNM. | See '''OpenVMS System Services Reference Manual''' for SYS$TRNLNM. | ||
;returns | |||
Status code | :Status code | ||
---- | |||
=== dellnm(tabnam:str, lognam:str, acmode:int)->int === | === dellnm(tabnam:str, lognam:str, acmode:int)->int === | ||
Deletes all logical names with the specified name. | Deletes all logical names with the specified name. | ||
;parameters | |||
: <code>tabnam:str</code> name of the logical name table or the name of a searchlist logical name | |||
: <code>lognam:str</code> logical name to be deleted | |||
: <code>acmode:int</code> access mode to be used in the delete operation. See '''vms.psldef''' | |||
;returns | |||
Status code | :Status code | ||
---- | |||
=== device_scan(search_devnam:str, item_list:object, context:int)->list === | === device_scan(search_devnam:str, item_list:object, context:int)->list === | ||
Returns the names of all devices that match a specified set of search criteria. | Returns the names of all devices that match a specified set of search criteria. | ||
;parameters | |||
: <code>search_devnam:str</code> name of the device for which <code>device_scan</code> to search | |||
: <code>item_list:object</code> item list specifying search criteria | |||
: <code>context:int</code> value used to indicate the current position of the search. On the initial call it must contain <code>0</code>. | |||
See '''OpenVMS System Services Reference Manual''' for SYS$DEVICE_SCAN | See '''OpenVMS System Services Reference Manual''' for SYS$DEVICE_SCAN | ||
;returns | |||
The list: | :The list: | ||
* <code>int</code> status code of the operation | :* <code>int</code> status code of the operation | ||
* <code>str</code> found device name | :* <code>str</code> found device name | ||
* <code>int</code> context | :* <code>int</code> context | ||
---- | |||
=== uicstr(uic:int, flags:int)->list === | === uicstr(uic:int, flags:int)->list === | ||
Converts UIC to a string. | Converts UIC to a string. | ||
;parameters | |||
: <code>uic:int</code> UIC | |||
: <code>flags:int</code> | |||
:* <code>0</code> - use "!%I" SYS$FAO format | |||
:* <code>1</code> - use "!%U" SYS$FAO format | |||
;returns | |||
The list: | :The list: | ||
* <code>int</code> status code of the operation | :* <code>int</code> status code of the operation | ||
* <code>str</code> UIC string | :* <code>str</code> UIC string | ||
---- | |||
=== getdvi(dev_nam:str, item_list:object)->int === | === getdvi(dev_nam:str, item_list:object)->int === | ||
Returns information related to the primary and secondary device characteristics of an I/O device. | Returns information related to the primary and secondary device characteristics of an I/O device. | ||
;parameters | |||
: <code>dev_nam:str</code> the name of the device for which information is to be returned | |||
: <code>item_list:object</code> item list specifying which information about the device is to be returned. | |||
See '''OpenVMS System Services Reference Manual''' for SYS$GETDVI | See '''OpenVMS System Services Reference Manual''' for SYS$GETDVI | ||
;returns | |||
Status code | :Status code | ||
---- | |||
=== getjpi(pid:int, pnam:str, item_list:object)->list === | === getjpi(pid:int, pnam:str, item_list:object)->list === | ||
Returns information about one or more processes of the system or across the OpenVMS Cluster system. | Returns information about one or more processes of the system or across the OpenVMS Cluster system. | ||
;parameters | |||
: <code>pid:int</code> process identification | |||
: <code>pnam:str</code> name of the process | |||
: <code>item_list:object</code> item list specifying which information about the process or processes is to be returned | |||
See '''OpenVMS System Services Reference Manual''' for SYS$GETJPI | See '''OpenVMS System Services Reference Manual''' for SYS$GETJPI | ||
;returns | |||
The list: | :The list: | ||
* <code>int</code> status code of the operation | :* <code>int</code> status code of the operation | ||
* <code>int</code> process id | :* <code>int</code> process id | ||
---- | |||
=== getlki(lki:int, item_list:object)->list === | === getlki(lki:int, item_list:object)->list === | ||
Returns information about the lock database on a system. | Returns information about the lock database on a system. | ||
;parameters | |||
: <code>lki:int</code> identification of the lock (lock ID) information about which needs to be returned | |||
: <code>item_list:object</code> item list specifying the lock information to be returned | |||
See '''OpenVMS System Services Reference Manual''' for SYS$GETLKI | See '''OpenVMS System Services Reference Manual''' for SYS$GETLKI | ||
;returns | |||
The list: | The list: | ||
: <code>int</code> status code of the operation | |||
: <code>int</code> lock identification | |||
=== getmsg(msgid:int, flags:int)->list === | === getmsg(msgid:int, flags:int)->list === | ||
Returns message text associated with a given message identification code. | Returns message text associated with a given message identification code. | ||
;parameters | |||
: <code>msgid:int</code> identification of the message to be retrieved | |||
: <code>flags:int</code> message components to be returned | |||
See '''OpenVMS System Services Reference Manual''' for SYS$GETMSG | See '''OpenVMS System Services Reference Manual''' for SYS$GETMSG | ||
;returns | |||
The list: | The list: | ||
: <code>int</code> status code of the operation | |||
: <code>str</code> message string | |||
: <code>int</code> optional information | |||
=== getqui(func:int, context:int, item_list:object)->list === | === getqui(func:int, context:int, item_list:object)->list === | ||
Returns information about queues and the jobs initiated from these queues. | Returns information about queues and the jobs initiated from these queues. | ||
;parameters | |||
: <code>func:int</code> function code specifying the function that <code>getqui</code> is to perform. See '''vms.quidef''' | |||
: <code>context:int</code> context stream for this call | |||
: <code>item_list:object</code> item list supplying the information to be used by the function | |||
See '''OpenVMS System Services Reference Manual''' for SYS$GETQUI | See '''OpenVMS System Services Reference Manual''' for SYS$GETQUI | ||
;returns | |||
The list: | The list: | ||
: <code>int</code> status code of the operation | |||
: <code>int</code> context | |||
=== getrmi(item_list:object)->int === | === getrmi(item_list:object)->int === | ||
Returns system performance information about the local system. | Returns system performance information about the local system. | ||
;parameters | |||
: <code>item_list:object</code> item list specifying which information about the local node is to be returned | |||
See '''OpenVMS System Services Reference Manual''' for SYS$GETRMI | See '''OpenVMS System Services Reference Manual''' for SYS$GETRMI | ||
;returns | |||
Status code | Status code | ||
=== getsyi(csid:int, node_name:str, item_list:object)->list === | === getsyi(csid:int, node_name:str, item_list:object)->list === | ||
Returns information about the local system or about other systems in an OpenVMS Cluster system. | Returns information about the local system or about other systems in an OpenVMS Cluster system. | ||
;parameters | |||
: <code>csid:int</code> OpenVMS Cluster system identification | |||
: <code>node_name:str</code> name of the node about which information is to be returned | |||
: <code>item_list:object</code> item list specifying which information about the node or nodes to return | |||
See '''OpenVMS System Services Reference Manual''' for SYS$GETSYI | See '''OpenVMS System Services Reference Manual''' for SYS$GETSYI | ||
;returns | |||
The list: | The list: | ||
: <code>int</code> status code of the operation | |||
: <code>int</code> csid | |||
=== gettim()->list === | === gettim()->list === | ||
Returns the current system time in a 64-bit format. | Returns the current system time in a 64-bit format. | ||
;parameters | |||
<code>None</code> | <code>None</code> | ||
;returns | |||
The list: | The list: | ||
: <code>int</code> status code of the operation | |||
: <code>int</code> current system time | |||
=== getuai(user_name:str, item_list:object)->int === | === getuai(user_name:str, item_list:object)->int === | ||
Returns authorization information about the specified user. | Returns authorization information about the specified user. | ||
;parameters | |||
: <code>user_name:str</code> name of the user to get authorization information for | |||
: <code>item_list:object</code> item list specifying which information to return | |||
See '''OpenVMS System Services Reference Manual''' for SYS$GETUAI | See '''OpenVMS System Services Reference Manual''' for SYS$GETUAI | ||
;returns | |||
Status code | Status code | ||
=== hiber()->int === | === hiber()->int === | ||
Allows a process to make itself inactive but to remain known to the system so that it can be interrupted. | Allows a process to make itself inactive but to remain known to the system so that it can be interrupted. | ||
;parameters | |||
<code>None</code> | <code>None</code> | ||
;returns | |||
Status code | Status code | ||
=== schdwk(pid:int, pname:str, time:int)->list === | === schdwk(pid:int, pname:str, time:int)->list === | ||
Schedules the awakening (restart) of a process that has placed itself in the state of hibernation with the Hibernate service. | Schedules the awakening (restart) of a process that has placed itself in the state of hibernation with the Hibernate service. | ||
;parameters | |||
: <code>pid:int</code> process identification (PID) of the process to be awakened | |||
: <code>pname:str</code> name of the process to be awakened | |||
: <code>time:int</code> time at which the process to be awakened | |||
See '''OpenVMS System Services Reference Manual''' for SYS$SCHDWK | See '''OpenVMS System Services Reference Manual''' for SYS$SCHDWK | ||
;returns | |||
The list: | The list: | ||
: <code>int</code> status code of the operation | |||
: <code>int</code> pid | |||
=== add_holder(id:int, holder:int, attrib:int)->int === | === add_holder(id:int, holder:int, attrib:int)->int === | ||
Adds a specified holder record to a target identifier. | Adds a specified holder record to a target identifier. | ||
;parameters | |||
: <code>id:int</code> target identifier granted to the specified holder | |||
: <code>holder:int</code> holder identifier that is granted access to the target identifier | |||
: <code>attrib:int</code> attributes to be placed in the holder record | |||
See '''OpenVMS System Services Reference Manual''' for SYS$ADD_HOLDER | See '''OpenVMS System Services Reference Manual''' for SYS$ADD_HOLDER | ||
;returns | |||
Status code | Status code | ||
=== add_ident(name:str, id:int, attrib:int)->list === | === add_ident(name:str, id:int, attrib:int)->list === | ||
Adds the specified identifier to the rights database. | Adds the specified identifier to the rights database. | ||
;parameters | |||
: <code>name:str</code> identifier name to be added to the rights database | |||
: <code>id:int</code> identifier to be created | |||
: <code>attrib:int</code> attributes placed in the identifier’s record | |||
See '''OpenVMS System Services Reference Manual''' for SYS$ADD_IDENT | See '''OpenVMS System Services Reference Manual''' for SYS$ADD_IDENT | ||
;returns | |||
The list: | The list: | ||
: <code>int</code> status code of the operation | |||
: <code>int</code> <code>resid</code>, identifier value assigned by the system | |||
=== find_held(holder:int, context:int)->list === | === find_held(holder:int, context:int)->list === | ||
Returns the identifiers held by the specified holder. | Returns the identifiers held by the specified holder. | ||
;parameters | |||
: <code>holder:int</code> holder whose identifiers to be found | |||
: <code>context:int</code> context value used when <code>find_held</code> is called repeatedly | |||
See '''OpenVMS System Services Reference Manual''' for SYS$FIND_HELD | See '''OpenVMS System Services Reference Manual''' for SYS$FIND_HELD | ||
;returns | |||
The list: | The list: | ||
: <code>int</code> status code of the operation | |||
: <code>int</code> <code>id</code>, identifier value that was found | |||
: <code>int</code> <code>attrib</code> attributes associated with the holder returned in <code>id</code> | |||
: <code>int</code> <code>context</code> | |||
=== finish_rdb(context:int)->int === | === finish_rdb(context:int)->int === | ||
Deallocates the record stream and clears the context value. | Deallocates the record stream and clears the context value. | ||
;parameters | |||
: <code>context:int</code> context value to be cleared | |||
;returns | |||
Status code | Status code | ||
=== forcex(pid:int, pname:str, code:int)->int === | === forcex(pid:int, pname:str, code:int)->int === | ||
Causes an Exit ($EXIT) service call to be issued on behalf of a specified process. | Causes an Exit ($EXIT) service call to be issued on behalf of a specified process. | ||
;parameters | |||
: <code>pid:int</code> process identification (PID) of the process to force exit | |||
: <code>pname:str</code> process name of the process that is to force exit | |||
: <code>code:int</code> completion code value to be used as the exit parameter | |||
;returns | |||
Status code | Status code | ||
=== rem_holder(id:int, holder:int)->int === | === rem_holder(id:int, holder:int)->int === | ||
Deletes the specified holder record from the target identifier’s list of holders. | Deletes the specified holder record from the target identifier’s list of holders. | ||
;parameters | |||
: <code>id:int</code> binary value of the target identifier | |||
: <code>holder:int</code> identifier of the holder being deleted | |||
;returns | |||
Status code | Status code | ||
=== rem_ident(id:int)->int === | === rem_ident(id:int)->int === | ||
Removes the specified identifier record and all its holder records (if any) from the rights database. | Removes the specified identifier record and all its holder records (if any) from the rights database. | ||
;parameters | |||
: <code>id:int</code> binary value of the identifier deleted from rights database | |||
;returns | |||
Status code | Status code | ||
=== setuai(user_name:str, item_list:object)->int === | === setuai(user_name:str, item_list:object)->int === | ||
Modifies the user authorization file (UAF) record for the specified user. | Modifies the user authorization file (UAF) record for the specified user. | ||
;parameters | |||
: <code>user_name:str</code> name of the user whose UAF record is modified | |||
: <code>item_list:object</code> item list specifying which information from the specified UAF record is to be modified | |||
See '''OpenVMS System Services Reference Manual''' for SYS$SETUAI | See '''OpenVMS System Services Reference Manual''' for SYS$SETUAI | ||
;returns | |||
Status code | Status code | ||
=== show_intrusion(user_criteria:str, flags:int, context:int)->list === | === show_intrusion(user_criteria:str, flags:int, context:int)->list === | ||
Searches for and returns information about records in the intrusion database matching the caller specifications. | Searches for and returns information about records in the intrusion database matching the caller specifications. | ||
;parameters | |||
: <code>user_criteria:str</code> description of an intruder or suspect | |||
: <code>flags:int</code> type of records in the intrusion database about which information is to be returned. NOTE: do not use '''vms.ciadef.CIA_M_ITEMLIST''', because <code>user_criteria</code> is a string | |||
: <code>context:int</code> context information to keep between related calls | |||
See '''OpenVMS System Services Reference Manual''' for SYS$SETUAI | See '''OpenVMS System Services Reference Manual''' for SYS$SETUAI | ||
;returns | |||
The list: | The list: | ||
: <code>int</code> status code of the operation | |||
: <code>str</code> <code>intruder</code>, user specification of the matched intruder or suspect record in the intrusion database | |||
: <code>int</code> <code>expires</code>, quadword time format indicating the time when the record will expire | |||
: <code>int</code> <code>type</code>, the types of the matched record and the status of the suspect | |||
: <code>int</code> <code>count</code>, number of login failures or break-in attempts | |||
== rdb == | == rdb == | ||
Wraps the '''Oracle RDB''' functions. | <br>Wraps the '''Oracle RDB''' functions. | ||
---- | |||
=== Attach(dbname:string)->int === | === Attach(dbname:string)->int === | ||
Attaches to the specified database. The string may specify the full path to the RDB database in OpenVMS format or (more commonly) a logical name pointing to the database. | Attaches to the specified database. The string may specify the full path to the RDB database in OpenVMS format or (more commonly) a logical name pointing to the database. | ||
;parameters | |||
: <code>dbname:string</code> path or logical name | |||
;returns | |||
Status code: | Status code: | ||
: <code>0</code> success | |||
: <code>-1</code> failed | |||
=== CloseCursor(cursor:object)->int === | === CloseCursor(cursor:object)->int === | ||
Closes the specified cursor. | Closes the specified cursor. | ||
;parameters | |||
: <code>cursor:object</code> cursor | |||
;returns | |||
Status code: | Status code: | ||
: <code>0</code> success | |||
: <code>-1</code> failed | |||
=== Commit()->int === | === Commit()->int === | ||
Commits the current database transaction. | Commits the current database transaction. | ||
;parameters | |||
<code>None</code> | <code>None</code> | ||
;returns | |||
Status code: | Status code: | ||
: <code>0</code> success | |||
: <code>-1</code> failed | |||
=== Data(cursor:object, idx:int)->str === | === Data(cursor:object, idx:int)->str === | ||
Given a cursor handle and column index (integer), returns the data value for the specified column for the last fetch operation. | Given a cursor handle and column index (integer), returns the data value for the specified column for the last fetch operation. | ||
;parameters | |||
: <code>cursor:object</code> cursor | |||
: <code>idx:int</code> index | |||
;returns | |||
Resulting string | Resulting string | ||
=== DeclareCursor(name:str, statement:str)->object === | === DeclareCursor(name:str, statement:str)->object === | ||
Declares a cursor. Inputs are the name for the cursor and the SQL statement. On success the function returns a cursor handle that can be used with <code>OpenCursor()</code>, <code>FetchCursor()</code>, and <code>CloseCursor()</code>. | Declares a cursor. Inputs are the name for the cursor and the SQL statement. On success the function returns a cursor handle that can be used with <code>OpenCursor()</code>, <code>FetchCursor()</code>, and <code>CloseCursor()</code>. | ||
;parameters | |||
: <code>name:str</code> name for the cursor | |||
: <code>statement:str</code> SQL statement | |||
;returns | |||
Resulting cursor | Resulting cursor | ||
=== Detach()->int === | === Detach()->int === | ||
Disconnects from the database. | Disconnects from the database. | ||
;parameters | |||
<code>None</code> | <code>None</code> | ||
;returns | |||
Status code: | Status code: | ||
: <code>0</code> success | |||
: <code>-1</code> failed | |||
=== Error()->str === | === Error()->str === | ||
Returns a description of the last error. | Returns a description of the last error. | ||
;parameters | |||
<code>None</code> | <code>None</code> | ||
;returns | |||
Resulting error string | Resulting error string | ||
=== Exec(sh:object)->int === | === Exec(sh:object)->int === | ||
Executes a previously prepared SQL statement. | Executes a previously prepared SQL statement. | ||
;parameters | |||
: <code>sh:object</code> prepared SQL statement | |||
;returns | |||
Status code: | Status code: | ||
: <code>0</code> success | |||
: <code>-1</code> failed | |||
=== ExecI(st:str)->int === | === ExecI(st:str)->int === | ||
Executes the supplied SQL statement immediately.<br> | Executes the supplied SQL statement immediately.<br> | ||
'''Note: the last letter is a capital 'i' | '''Note: the last letter is a capital 'i' | ||
;parameters | |||
: <code>st:str</code> SQL statement | |||
;returns | |||
Status code: | Status code: | ||
: <code>0</code> success | |||
: <code>-1</code> failed | |||
=== Fetch(cursor:object)->int === | === Fetch(cursor:object)->int === | ||
Fetches a row of data for the specified cursor but does not explicitly return the fetched data. The <code>Data()</code> method can then be used to retrieve individual data values for each column (<code>Ncol()</code> can be used to determine the number of columns). | Fetches a row of data for the specified cursor but does not explicitly return the fetched data. The <code>Data()</code> method can then be used to retrieve individual data values for each column (<code>Ncol()</code> can be used to determine the number of columns). | ||
;parameters | |||
: <code>cursor:object</code> cursor | |||
;returns | |||
Status code: | Status code: | ||
: <code>1</code> success | |||
: <code>0</code> success, end of stream | |||
: <code>-1</code> failed | |||
=== FetchRow(cursor:object)->list === | === FetchRow(cursor:object)->list === | ||
Fetches a row of data using the specified cursor handle. The fetched data is returned as an list of strings. | Fetches a row of data using the specified cursor handle. The fetched data is returned as an list of strings. | ||
;parameters | |||
: <code>cursor:object</code> cursor | |||
;returns | |||
The list of strings | The list of strings | ||
=== Free(cursor:object)->int === | === Free(cursor:object)->int === | ||
Frees resources associated with the supplied cursor handle for a cursor previously declared via <code>DeclareCursor()</code>. | Frees resources associated with the supplied cursor handle for a cursor previously declared via <code>DeclareCursor()</code>. | ||
;parameters | |||
: <code>cursor:object</code> cursor | |||
;returns | |||
Status code: | Status code: | ||
: <code>0</code> success | |||
=== Ncol(cursor:object)->int === | === Ncol(cursor:object)->int === | ||
Returns the number of columns (values) that would be returned by a fetch for the specified cursor. | Returns the number of columns (values) that would be returned by a fetch for the specified cursor. | ||
;parameters | |||
: <code>cursor:object</code> cursor | |||
;returns | |||
Number of columns | Number of columns | ||
=== OpenCursor(cursor:object)->int === | === OpenCursor(cursor:object)->int === | ||
Opens a cursor using the supplied (previously declared) cursor handle. | Opens a cursor using the supplied (previously declared) cursor handle. | ||
;parameters | |||
: <code>cursor:object</code> cursor | |||
;returns | |||
Status code: | Status code: | ||
: <code>0</code> success | |||
: <code>-1</code> failed | |||
=== Prepare(st:string)->object === | === Prepare(st:string)->object === | ||
Prepares an SQL statement and returns a handle for the prepared statement that can be used in subsequent calls to Exec(). | Prepares an SQL statement and returns a handle for the prepared statement that can be used in subsequent calls to Exec(). | ||
;parameters | |||
: <code>st:string</code> SQL statement | |||
;returns | |||
Resulting prepared statement | Resulting prepared statement | ||
=== Rollback()->int === | === Rollback()->int === | ||
Rolls back the current database transaction. | Rolls back the current database transaction. | ||
;parameters | |||
<code>None</code> | <code>None</code> | ||
;returns | |||
Status code: | Status code: | ||
: <code>0</code> success | |||
: <code>-1</code> failed | |||
=== SetReadonly()->int === | === SetReadonly()->int === | ||
Starts a read-only transaction. | Starts a read-only transaction. | ||
;parameters | |||
<code>None</code> | <code>None</code> | ||
;returns | |||
Status code: | Status code: | ||
: <code>0</code> success | |||
: <code>-1</code> failed | |||
=== Sqlcode()->int === | === Sqlcode()->int === | ||
Returns the SQLCODE for the last database operation. | Returns the SQLCODE for the last database operation. | ||
;parameters | |||
<code>None</code> | <code>None</code> | ||
;returns | |||
Resulting SQL code | Resulting SQL code | ||
Revision as of 05:47, 1 September 2020
VMS specific Python modules.
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:strpath to the shared image- returns
1if the shared image exists and can be opened by dlopen()0otherwise
fix_time(vms_time:int)->int
Converts VMS time to the Unix time.
- parameters
vms_time:intVMS 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:strpath in VMS format (supports wildcards)wild_flag:intIf set to0, wildcards found in thevms_pathare 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:strname of the environment variabledef_value:strdefault 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:intseconds to sleep- returns
- The number of seconds left to the end of the sleep period if sleep is interrupted.
0if 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:intsystem 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:strfile name in UNIX style file specification formatallow_wild:intIf set to0, wildcards found inunix_pathare not expandedno_directory:intAn 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:intOpenVMS system time- returns
- Unix time
vmstime(unix_time:int)->int
Converts Unix time to the OpenVMS system time.
- parameters
unix_time:intUnix 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:objectitem list to be removed- returns
- OpenVMS system time
size(il:object)->int
Gets size of the item list.
- parameters
il:objectitem 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:objectitem listitem:intitem to additem_type:inttype of the item. See vms.dscdefitem_value:intvalue of the item- returns
None
getint(il:object, index:int)->int
Gets the integer at the specified index in the list.
- parameters
il:objectitem listindex:intindex 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:objectitem listindex:intindex 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:objectitem listitem:intitem to additem_value:strvalue to add (orNone)item_length:intlength of the buffer if theitem_valueisNone- 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:objectitem listitem:intitem to additem_value:strvalue to additem_length:intlength 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:objectitem listitem:intitem to additem_value:strvalue to additem_length:intlength 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:objectitem listindex:intindex of the item to getflag:intif 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:objectitem listitem:intitem to additem_value:intvalue to storeitem_offset:intstarting byteitem_len:intamount 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:objectitem listindex:intindex of the itemitem_offset:intstarting 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:strname of the directory to be created (specified in OpenVMS style)uic:intunsigned integer value of the owner UIC:None- the current user0- owner of the parent directory
pe:intprotection enable. See full documentation in the OpenVMS RTL Library(LIB$) Manual for LIB$CREATE_DIR.pv:intprotection value- returns
vms.ssdef.SS__CREATEDone or more directories createdvms.ssdef.SS__NORMALall specified directories already exist- another error. See in vms.ssdef
date_time()->list
Gets current date and time.
- parameters
None- returns
- The list:
intstatus code of the operationstrresulting string
get_ef()->list
Allocates a local event flag.
- parameters
None- returns
- The list:
intstatus code of the operationintresulting event flag
free_ef(ef:int)->int
Releases the local event flag.
- parameters
ef:intthe local event flag- returns
- Status code of the operation
put_common(common:str)->int
Copies a string into the common area.
- parameters
common:strstring to copy- returns
- Status code of the operation
get_common()->list
Gets the string from the common area.
- parameters
None- returns
- The list:
intstatus code of the operationstrresulting string
get_hostname(flags:int)->list
Gets the host name of the local system.
- parameters
flags:intif set to1, the host node name is returned in the parsable form- returns
- The list:
intstatus code of the operationstrresulting host node name
getjpi(item_code:int, pid:int, pname:str)->list
Gets the specified job/process information as a string.
- parameters
item_code:intitem identifier code defining the item of information to be returned. See vms.jpidefpid:intprocess idpname:strprocess 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:
intstatus code of the operationstrresulting string
getsyi(item_code:int, node_name:str)->list
Gets system wide information as a string.
- parameters
item_code:intitem identifier code defining the item of information to be returned. See vms.syidefnode_name:strnode name- returns
- The list:
intstatus code of the operationstrresulting stringintresulting 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:strcommand to executeinput_file:strequivalence name to be associated with the logical name SYS$INPUToutput_file:strequivalence name to be associated with the logical name SYS$OUTPUTflags:intflag bits that designate optional behavior. See vms.clidefpname:strname defined for the subprocess- returns
- The list:
intstatus code of the operationintprocess 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:strcommand 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:intOpenVMS system time. A negative time value represents a delta time.time_only:intif set to1, asctim returns the hour only.- returns
- The list:
intstatus code of the operationstrresulting 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:strin format:- Absolute Time: dd-mmm-yyyy hh:mm:ss.cc
- Delta Time: dddd hh:mm:ss.cc
- returns
- The list:
intstatus code of the operationintresulting time value
asctoid(name:str)->list
Translates the specified identifier name into its binary identifier value.
- parameters
name:stridentifier name- returns
- The list:
intstatus code of the operationintresulting identifier valueintresulting identifier attributes. See vms.kgbdef
idtoasc(id_val:int, context:int)->list
Translates the specified identifier value to the identifier name.
- parameters
id_val:intidentifier value. See OpenVMS System Services Reference Manual for SYS$IDTOASCcontext:intcontext value used whenidtoascis called repeatedly. Must be initialized with the value 0.- returns
- The list:
intstatus code of the operationstrresulting identifier nameintresulting identifier valueintresulting identifier attributes. See vms.kgbdefintresulting 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:intthe first bit specifies a permanent mailboxmaxmsg:intmaximum size of a message (in bytes)bufquo:intnumber of bytes of system dynamic memory that can be used to buffer messages sent to the mailboxpromsk:intprotection mask to be associated with the created mailboxacmode:intaccess mode to be associated with the channel to which the mailbox is assignedmbx_name:stringlogical name to be assigned to the mailboxflags:intoptions for the assign operation. See vms.cmbdef- returns
- The list:
intstatus code of the operationintresulting channel
delmbx(channel:int)->int
Marks a permanent mailbox for deletion.
- parameters
channel:intmailbox channel- returns
- Status code
assign(devnam:str, acmode:int, mbxnam:str, flags:int)->list
Provides a process with an I/O channel.
- parameters
devnam:strname of the deviceacmode:intaccess mode to be associated with the channelmbxnam:strlogical name of the mailbox to be associated with the deviceflags:intan optional device-specific argument- returns
- The list:
intstatus code of the operationintresulting channel
dassgn(channel:int)->int
Unassigns (releases) an I/O channel.
- parameters
channel:intnumber 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:intI/O channelmax_read:intamount of bytes to readblock:intstarting blockfmod:intfunction code modifiers- returns
- The list:
intstatus code of the operationbyteresulting bufferintI/O completion code
writevblk(channel:int, buffer:bytes, block:int, fmod:int)->list
Write to I/O channel.
- parameters
channel:intI/O channelbuffer:bytesbytes to writeblock:intstarting blockfmod:intfunction code modifiers- returns
- The list:
intstatus code of the operationintamount of written bytesintI/O completion code
cancel(channel:int)->int
Cancel I/O operation.
- parameters
channel:intI/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:intattributes to be associated with the logical name. See vms.lnmdeftabnam:strname of the table in which to create the logical namelognam:strlogical name to be createdacmode:intaccess mode to be associated with the logical name. See vms.psldefil:objectitem list, created viavms.ile3.new()
See OpenVMS System Services Reference Manual for SYS$CRELNM.
- returns
- Status code
trnlnm(attr:int, tabnam:str, lognam:str, acmode:int, il:object)->int
Returns information about the specified logical name.
- parameters
attr:intattributes controlling the search for the logical name. See vms.lnmdeftabnam:strname of the logical name table or the name of a searchlist logical namelognam:strlogical name for which information is to be returnedacmode:intaccess mode to be used in the translation. See vms.psldefil:objectitem list, created viavms.ile3.new()
See OpenVMS System Services Reference Manual for SYS$TRNLNM.
- returns
- Status code
dellnm(tabnam:str, lognam:str, acmode:int)->int
Deletes all logical names with the specified name.
- parameters
tabnam:strname of the logical name table or the name of a searchlist logical namelognam:strlogical name to be deletedacmode:intaccess mode to be used in the delete operation. See vms.psldef- returns
- Status code
device_scan(search_devnam:str, item_list:object, context:int)->list
Returns the names of all devices that match a specified set of search criteria.
- parameters
search_devnam:strname of the device for whichdevice_scanto searchitem_list:objectitem list specifying search criteriacontext:intvalue used to indicate the current position of the search. On the initial call it must contain0.
See OpenVMS System Services Reference Manual for SYS$DEVICE_SCAN
- returns
- The list:
intstatus code of the operationstrfound device nameintcontext
uicstr(uic:int, flags:int)->list
Converts UIC to a string.
- parameters
uic:intUICflags:int0- use "!%I" SYS$FAO format1- use "!%U" SYS$FAO format
- returns
- The list:
intstatus code of the operationstrUIC string
getdvi(dev_nam:str, item_list:object)->int
Returns information related to the primary and secondary device characteristics of an I/O device.
- parameters
dev_nam:strthe name of the device for which information is to be returneditem_list:objectitem list specifying which information about the device is to be returned.
See OpenVMS System Services Reference Manual for SYS$GETDVI
- returns
- Status code
getjpi(pid:int, pnam:str, item_list:object)->list
Returns information about one or more processes of the system or across the OpenVMS Cluster system.
- parameters
pid:intprocess identificationpnam:strname of the processitem_list:objectitem list specifying which information about the process or processes is to be returned
See OpenVMS System Services Reference Manual for SYS$GETJPI
- returns
- The list:
intstatus code of the operationintprocess id
getlki(lki:int, item_list:object)->list
Returns information about the lock database on a system.
- parameters
lki:intidentification of the lock (lock ID) information about which needs to be returneditem_list:objectitem list specifying the lock information to be returned
See OpenVMS System Services Reference Manual for SYS$GETLKI
- returns
The list:
intstatus code of the operationintlock identification
getmsg(msgid:int, flags:int)->list
Returns message text associated with a given message identification code.
- parameters
msgid:intidentification of the message to be retrievedflags:intmessage components to be returned
See OpenVMS System Services Reference Manual for SYS$GETMSG
- returns
The list:
intstatus code of the operationstrmessage stringintoptional information
getqui(func:int, context:int, item_list:object)->list
Returns information about queues and the jobs initiated from these queues.
- parameters
func:intfunction code specifying the function thatgetquiis to perform. See vms.quidefcontext:intcontext stream for this callitem_list:objectitem list supplying the information to be used by the function
See OpenVMS System Services Reference Manual for SYS$GETQUI
- returns
The list:
intstatus code of the operationintcontext
getrmi(item_list:object)->int
Returns system performance information about the local system.
- parameters
item_list:objectitem list specifying which information about the local node is to be returned
See OpenVMS System Services Reference Manual for SYS$GETRMI
- returns
Status code
getsyi(csid:int, node_name:str, item_list:object)->list
Returns information about the local system or about other systems in an OpenVMS Cluster system.
- parameters
csid:intOpenVMS Cluster system identificationnode_name:strname of the node about which information is to be returneditem_list:objectitem list specifying which information about the node or nodes to return
See OpenVMS System Services Reference Manual for SYS$GETSYI
- returns
The list:
intstatus code of the operationintcsid
gettim()->list
Returns the current system time in a 64-bit format.
- parameters
None
- returns
The list:
intstatus code of the operationintcurrent system time
getuai(user_name:str, item_list:object)->int
Returns authorization information about the specified user.
- parameters
user_name:strname of the user to get authorization information foritem_list:objectitem list specifying which information to return
See OpenVMS System Services Reference Manual for SYS$GETUAI
- returns
Status code
hiber()->int
Allows a process to make itself inactive but to remain known to the system so that it can be interrupted.
- parameters
None
- returns
Status code
schdwk(pid:int, pname:str, time:int)->list
Schedules the awakening (restart) of a process that has placed itself in the state of hibernation with the Hibernate service.
- parameters
pid:intprocess identification (PID) of the process to be awakenedpname:strname of the process to be awakenedtime:inttime at which the process to be awakened
See OpenVMS System Services Reference Manual for SYS$SCHDWK
- returns
The list:
intstatus code of the operationintpid
add_holder(id:int, holder:int, attrib:int)->int
Adds a specified holder record to a target identifier.
- parameters
id:inttarget identifier granted to the specified holderholder:intholder identifier that is granted access to the target identifierattrib:intattributes to be placed in the holder record
See OpenVMS System Services Reference Manual for SYS$ADD_HOLDER
- returns
Status code
add_ident(name:str, id:int, attrib:int)->list
Adds the specified identifier to the rights database.
- parameters
name:stridentifier name to be added to the rights databaseid:intidentifier to be createdattrib:intattributes placed in the identifier’s record
See OpenVMS System Services Reference Manual for SYS$ADD_IDENT
- returns
The list:
intstatus code of the operationintresid, identifier value assigned by the system
find_held(holder:int, context:int)->list
Returns the identifiers held by the specified holder.
- parameters
holder:intholder whose identifiers to be foundcontext:intcontext value used whenfind_heldis called repeatedly
See OpenVMS System Services Reference Manual for SYS$FIND_HELD
- returns
The list:
intstatus code of the operationintid, identifier value that was foundintattribattributes associated with the holder returned inidintcontext
finish_rdb(context:int)->int
Deallocates the record stream and clears the context value.
- parameters
context:intcontext value to be cleared- returns
Status code
forcex(pid:int, pname:str, code:int)->int
Causes an Exit ($EXIT) service call to be issued on behalf of a specified process.
- parameters
pid:intprocess identification (PID) of the process to force exitpname:strprocess name of the process that is to force exitcode:intcompletion code value to be used as the exit parameter- returns
Status code
rem_holder(id:int, holder:int)->int
Deletes the specified holder record from the target identifier’s list of holders.
- parameters
id:intbinary value of the target identifierholder:intidentifier of the holder being deleted- returns
Status code
rem_ident(id:int)->int
Removes the specified identifier record and all its holder records (if any) from the rights database.
- parameters
id:intbinary value of the identifier deleted from rights database- returns
Status code
setuai(user_name:str, item_list:object)->int
Modifies the user authorization file (UAF) record for the specified user.
- parameters
user_name:strname of the user whose UAF record is modifieditem_list:objectitem list specifying which information from the specified UAF record is to be modified
See OpenVMS System Services Reference Manual for SYS$SETUAI
- returns
Status code
show_intrusion(user_criteria:str, flags:int, context:int)->list
Searches for and returns information about records in the intrusion database matching the caller specifications.
- parameters
user_criteria:strdescription of an intruder or suspectflags:inttype of records in the intrusion database about which information is to be returned. NOTE: do not use vms.ciadef.CIA_M_ITEMLIST, becauseuser_criteriais a stringcontext:intcontext information to keep between related calls
See OpenVMS System Services Reference Manual for SYS$SETUAI
- returns
The list:
intstatus code of the operationstrintruder, user specification of the matched intruder or suspect record in the intrusion databaseintexpires, quadword time format indicating the time when the record will expireinttype, the types of the matched record and the status of the suspectintcount, number of login failures or break-in attempts
rdb
Wraps the Oracle RDB functions.
Attach(dbname:string)->int
Attaches to the specified database. The string may specify the full path to the RDB database in OpenVMS format or (more commonly) a logical name pointing to the database.
- parameters
dbname:stringpath or logical name- returns
Status code:
0success-1failed
CloseCursor(cursor:object)->int
Closes the specified cursor.
- parameters
cursor:objectcursor- returns
Status code:
0success-1failed
Commit()->int
Commits the current database transaction.
- parameters
None
- returns
Status code:
0success-1failed
Data(cursor:object, idx:int)->str
Given a cursor handle and column index (integer), returns the data value for the specified column for the last fetch operation.
- parameters
cursor:objectcursoridx:intindex- returns
Resulting string
DeclareCursor(name:str, statement:str)->object
Declares a cursor. Inputs are the name for the cursor and the SQL statement. On success the function returns a cursor handle that can be used with OpenCursor(), FetchCursor(), and CloseCursor().
- parameters
name:strname for the cursorstatement:strSQL statement- returns
Resulting cursor
Detach()->int
Disconnects from the database.
- parameters
None
- returns
Status code:
0success-1failed
Error()->str
Returns a description of the last error.
- parameters
None
- returns
Resulting error string
Exec(sh:object)->int
Executes a previously prepared SQL statement.
- parameters
sh:objectprepared SQL statement- returns
Status code:
0success-1failed
ExecI(st:str)->int
Executes the supplied SQL statement immediately.
Note: the last letter is a capital 'i'
- parameters
st:strSQL statement- returns
Status code:
0success-1failed
Fetch(cursor:object)->int
Fetches a row of data for the specified cursor but does not explicitly return the fetched data. The Data() method can then be used to retrieve individual data values for each column (Ncol() can be used to determine the number of columns).
- parameters
cursor:objectcursor- returns
Status code:
1success0success, end of stream-1failed
FetchRow(cursor:object)->list
Fetches a row of data using the specified cursor handle. The fetched data is returned as an list of strings.
- parameters
cursor:objectcursor- returns
The list of strings
Free(cursor:object)->int
Frees resources associated with the supplied cursor handle for a cursor previously declared via DeclareCursor().
- parameters
cursor:objectcursor- returns
Status code:
0success
Ncol(cursor:object)->int
Returns the number of columns (values) that would be returned by a fetch for the specified cursor.
- parameters
cursor:objectcursor- returns
Number of columns
OpenCursor(cursor:object)->int
Opens a cursor using the supplied (previously declared) cursor handle.
- parameters
cursor:objectcursor- returns
Status code:
0success-1failed
Prepare(st:string)->object
Prepares an SQL statement and returns a handle for the prepared statement that can be used in subsequent calls to Exec().
- parameters
st:stringSQL statement- returns
Resulting prepared statement
Rollback()->int
Rolls back the current database transaction.
- parameters
None
- returns
Status code:
0success-1failed
SetReadonly()->int
Starts a read-only transaction.
- parameters
None
- returns
Status code:
0success-1failed
Sqlcode()->int
Returns the SQLCODE for the last database operation.
- parameters
None
- returns
Resulting SQL code