Difference between revisions of "VMS-Specific Python Modules"
m (→fix_time(vms_time:int)->int) |
m (→RMS) |
||
(74 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
== vms.decc == | == vms.decc == | ||
<br>Wraps the '''C Run-Time Library for OpenVMS Systems''' functions.<br> | <br>Wraps the '''C Run-Time Library for OpenVMS Systems''' functions.<br> | ||
---- | ---- | ||
=== dlopen_test(name:str)->int === | === dlopen_test(name:str)->int === | ||
− | + | Checks if a shared image can be opened and loaded into memory. | |
;parameters | ;parameters | ||
− | : <code>name:str</code> path to the shared image | + | : <code>name:str</code>: path to the shared image |
;returns | ;returns | ||
− | : <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 the VMS time to the Unix time. | + | Converts the VMS time to the Unix time stamp. |
;parameters | ;parameters | ||
− | : <code>vms_time:int</code> VMS system time | + | : <code>vms_time:int</code>: VMS system time |
;returns | ;returns | ||
:Time in the Unix format (number of seconds since 01/01/1970) | :Time in the Unix format (number of seconds since 01/01/1970) | ||
---- | ---- | ||
− | |||
=== 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 the VMS path to a list of Unix paths. |
;parameters | ;parameters | ||
− | : <code>vms_path:str</code> path in VMS format (supports wildcards) | + | : <code>vms_path:str</code>: path in the VMS format (supports wildcards) |
− | : <code>wild_flag:int</code> If set to <code>0</code>, wildcards found in | + | : <code>wild_flag:int</code>: If set to <code>0</code>, the wildcards found in <code>vms_path</code> are not expanded |
;returns | ;returns | ||
− | :List of paths in Unix | + | :List of paths in the Unix notation |
---- | ---- | ||
=== 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''' | + | Gets the specified environment variable value. See getenv() description in the '''VSI C Run-Time Library Reference Manual for OpenVMS Systems'''. |
;parameters | ;parameters | ||
− | : <code>name:str</code> name of the environment variable | + | : <code>name:str</code>: name of the environment variable |
− | : <code>def_value:str</code> default value | + | : <code>def_value:str</code>: default value |
;returns | ;returns | ||
:Environment variable value | :Environment variable value | ||
Line 38: | Line 36: | ||
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 | ;parameters | ||
− | : <code>seconds:int</code> seconds to sleep | + | : <code>seconds:int</code>: seconds to sleep |
;returns | ;returns | ||
− | :The number of seconds left | + | :The number of seconds left before the sleep timer expires if sleep is interrupted. <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 | ;parameters | ||
− | : <code>name:int</code> system variable to be queried | + | : <code>name:int</code>: system variable to be queried |
;returns | ;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 the UNIX style file specifications to the OpenVMS file specifications. |
;parameters | ;parameters | ||
− | : <code>unix_path:str</code> file name | + | : <code>unix_path:str</code>: file name following the Unix file naming conventions |
− | : <code>allow_wild:int</code> If set to <code>0</code>, wildcards found in <code>unix_path</code> are not expanded | + | : <code>allow_wild:int</code>: If set to <code>0</code>, the wildcards found in <code>unix_path</code> are not expanded |
: <code>no_directory:int</code> An integer that has one of the following values: | : <code>no_directory:int</code> An integer that has one of the following values: | ||
:* 0 - Directory allowed | :* 0 - Directory allowed | ||
Line 59: | Line 57: | ||
:* 2 - Force expansion of the string as a directory name | :* 2 - Force expansion of the string as a directory name | ||
;returns | ;returns | ||
− | List of | + | List of OpenVMS style pathnames |
---- | ---- | ||
=== unixtime(vms_time:int)->int === | === unixtime(vms_time:int)->int === | ||
− | Converts OpenVMS system time to the Unix local time. | + | Converts the OpenVMS system time to the Unix local time. |
;parameters | ;parameters | ||
: <code>vms_time:int</code> OpenVMS system time | : <code>vms_time:int</code> OpenVMS system time | ||
Line 71: | Line 69: | ||
Converts Unix time to the OpenVMS system time. | Converts Unix time to the OpenVMS system time. | ||
;parameters | ;parameters | ||
− | : <code>unix_time:int</code> Unix time | + | : <code>unix_time:int</code>: Unix time |
;returns | ;returns | ||
OpenVMS system time | OpenVMS system time | ||
---- | ---- | ||
+ | === get_symbol(name:str)->list === | ||
+ | Requests the calling process’s command language interpreter (CLI) to return the value of a CLI symbol as a string. | ||
+ | ;parameters | ||
+ | : <code>name:str</code>: Name of the symbol | ||
+ | ;returns | ||
+ | :The list: | ||
+ | :*<code>int</code>: status code of the operation | ||
+ | :*<code>str</code>: value of the returned symbol | ||
+ | ---- | ||
+ | === fopen(path:str, mode:str, ...)->fp:object === | ||
+ | Opens a file. | ||
+ | ;parameters | ||
+ | : <code>path:str</code>: A character string containing a valid file specification | ||
+ | : <code>mode:str</code>: The access mode indicator | ||
+ | : <code>...:str</code>: Optional file attribute arguments | ||
+ | ;returns | ||
+ | :*<code>fp:object</code>: File pointer | ||
+ | ---- | ||
+ | === fclose(fp:object)->status:int === | ||
+ | Closes a file. | ||
+ | ;parameters | ||
+ | : <code>fp:object</code>: A pointer to the file to be closed | ||
+ | ;returns | ||
+ | :*<code>status:int</code>: status code of the operation | ||
+ | ---- | ||
+ | === fileno(fp:object)->fd:int === | ||
+ | Returns the file descriptor associated with the specified file pointer. | ||
+ | ;parameters | ||
+ | : <code>fp:object</code>: A pointer to the file | ||
+ | ;returns | ||
+ | :*<code>fd:int</code>: Integer file descriptor | ||
+ | ---- | ||
+ | === write(fd:int, data:bytes)->nbytes:int === | ||
+ | Writes bytes to a file. | ||
+ | ;parameters | ||
+ | : <code>fd:int</code>: Integer file descriptor | ||
+ | : <code>data:bytes</code>: Bytes to write | ||
+ | ;returns | ||
+ | :*<code>nbytes:int</code>: The number of bytes written | ||
+ | ---- | ||
+ | |||
+ | === fgets(fp:object, maxchars:int)->line:str === | ||
+ | Reads a line from the specified file, up to one less than the specified maximum | ||
+ | number of characters or up to and including the newline character, whichever | ||
+ | comes first. | ||
+ | ;parameters | ||
+ | : <code>fp:object</code>: A pointer to the file | ||
+ | : <code>maxchars:int</code>: The maximum number of characters to fetch | ||
+ | ;returns | ||
+ | :*<code>line:str</code>: The fetched line | ||
+ | ---- | ||
+ | |||
+ | === feof(fp:object)->status:int === | ||
+ | Tests a file to see if the end-of-file has been reached. | ||
+ | ;parameters | ||
+ | : <code>fp:object</code>: A pointer to the file | ||
+ | ;returns | ||
+ | :*<code>status:int</code>: Nonzero integer indicates that the end-of-file has been reached | ||
+ | ---- | ||
+ | === ferror(fp:object)->status:int === | ||
+ | Returns a nonzero integer if an error occurred while reading or writing a file. | ||
+ | ;parameters | ||
+ | : <code>fp:object</code>: A pointer to the file | ||
+ | ;returns | ||
+ | :*<code>status:int</code>: Nonzero integer indicates that an error has occurred | ||
+ | ---- | ||
+ | |||
== vms.ile3 == | == vms.ile3 == | ||
− | <br>Provides functions | + | <br>Provides functions to work with item lists.<br> |
---- | ---- | ||
=== new()->object === | === new()->object === | ||
− | Creates empty item list. | + | Creates an empty item list. |
;parameters | ;parameters | ||
− | :<code>None</code> | + | : <code>None</code> |
;returns | ;returns | ||
:New empty item list | :New empty item list | ||
---- | ---- | ||
=== delete(il:object)->None === | === delete(il:object)->None === | ||
− | Deletes item list. | + | Deletes the item list. |
;parameters | ;parameters | ||
− | : <code>il:object</code> item list to be removed | + | : <code>il:object</code>: item list to be removed |
;returns | ;returns | ||
− | : | + | : <code>None</code> |
---- | ---- | ||
=== size(il:object)->int === | === size(il:object)->int === | ||
− | Gets size of the item list. | + | Gets the size of the item list. |
;parameters | ;parameters | ||
− | : <code>il:object</code> item list | + | : <code>il:object</code>: item list |
;returns | ;returns | ||
:The size of the specified item list | :The size of the specified item list | ||
Line 102: | Line 167: | ||
Adds a new integer to the item list. | Adds a new integer to the item list. | ||
;parameters | ;parameters | ||
− | : <code>il:object</code> item list | + | : <code>il:object</code>: item list |
− | : <code>item:int</code> item to add | + | : <code>item:int</code>: item to add |
− | : <code>item_type:int</code> type of the item. See '''vms.dscdef''' | + | : <code>item_type:int</code>: type of the item. See '''vms.dscdef''' |
− | : <code>item_value:int</code> value of the item | + | : <code>item_value:int</code>: value of the item |
;returns | ;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 item list. |
;parameters | ;parameters | ||
− | : <code>il:object</code> item list | + | : <code>il:object</code>: item list |
− | : <code>index:int</code> index of the item to get | + | : <code>index:int</code>: index of the item to get |
;returns | ;returns | ||
:Integer value | :Integer value | ||
Line 120: | Line 185: | ||
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 | ;parameters | ||
− | : <code>il:object</code> item list | + | : <code>il:object</code>: item list |
− | : <code>index:int</code> index of the item to get | + | : <code>index:int</code>: index of the item to get |
;returns | ;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 | + | Adds the specified string to the item list. If <code>item_value</code> is not <code>None</code>, <code>item_length</code> is ignored and the length of the buffer will be the same as the length of <code>item_value</code>. |
;parameters | ;parameters | ||
− | : <code>il:object</code> item list | + | : <code>il:object</code>: item list |
− | : <code>item:int</code> item to add | + | : <code>item:int</code>: item to add |
− | : <code>item_value:str</code> value to add (or <code>None</code>) | + | : <code>item_value:str</code>: value to add (or <code>None</code>) |
− | : <code>item_length:int</code> length of the buffer if | + | : <code>item_length:int</code>: length of the buffer if <code>item_value</code> is <code>None</code> |
;returns | ;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 | + | Adds the specified space-expanded string to the item list. The first byte of the buffer is the length of the string. If <code>item_value</code> is longer than <code>item_length</code>, it will be truncated. |
;parameters | ;parameters | ||
− | : <code>il:object</code> item list | + | : <code>il:object</code>: item list |
− | : <code>item:int</code> item to add | + | : <code>item:int</code>: item to add |
− | : <code>item_value:str</code> value 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) | + | : <code>item_length:int</code>: length of the buffer (the resulting string length is one byte less) |
;returns | ;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 | + | Adds the specified space-expanded string to the item list. If <code>item_value</code> is longer than <code>item_length</code>, it will be truncated. |
;parameters | ;parameters | ||
− | : <code>il:object</code> item list | + | : <code>il:object</code>: item list |
− | : <code>item:int</code> item to add | + | : <code>item:int</code>: item to add |
− | : <code>item_value:str</code> value to add | + | : <code>item_value:str</code>: value to add |
− | : <code>item_length:int</code> length of the buffer | + | : <code>item_length:int</code>: length of the buffer |
;returns | ;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 | ;parameters | ||
− | : <code>il:object</code> item list | + | : <code>il:object</code>: item list |
− | : <code>index:int</code> index of the item to get | + | : <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 | + | : <code>flag:int</code>: if set to <code>1</code>, the first byte of the resulting string is the length of the string |
;returns | ;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. | + | Adds a new binary item to the item list. This item will be interpreted as a string. |
;parameters | ;parameters | ||
− | : <code>il:object</code> item list | + | : <code>il:object</code>: item list |
− | : <code>item:int</code> item to add | + | : <code>item:int</code>: item to add |
− | : <code>item_value:int</code> value to store | + | : <code>item_value:int</code>: value to store |
− | : <code>item_offset:int</code> starting byte | + | : <code>item_offset:int</code>: starting byte |
− | : <code>item_len:int</code> amount of bytes | + | : <code>item_len:int</code>: amount of bytes |
;returns | ;returns | ||
:<code>None</code> | :<code>None</code> | ||
Line 178: | Line 243: | ||
Gets the byte at the specified position in the item list. | Gets the byte at the specified position in the item list. | ||
;parameters | ;parameters | ||
− | : <code>il:object</code> item list | + | : <code>il:object</code>: item list |
− | : <code>index:int</code> index of the item | + | : <code>index:int</code>: index of the item |
− | : <code>item_offset:int</code> starting byte | + | : <code>item_offset:int</code>: starting byte |
;returns | ;returns | ||
:Integer value of the specified byte | :Integer value of the specified byte | ||
---- | ---- | ||
+ | |||
== vms.lib == | == vms.lib == | ||
− | <br>Wraps the '''OpenVMS RTL Library(LIB$)''' functions.<br> | + | <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 | ;parameters | ||
− | : <code>name:str</code> name of the directory to be created ( | + | : <code>name:str</code>: name of the directory to be created (following the OpenVMS naming conventions) |
− | : <code>uic:int</code> unsigned integer value of the owner UIC: | + | : <code>uic:int</code>: unsigned integer value of the owner UIC: |
− | :*<code>None</code> | + | :*<code>None</code>: current user |
− | :*<code>0</code> | + | :*<code>0</code>: owner of the parent directory |
− | : <code>pe:int</code> protection enable. | + | : <code>pe:int</code>: protection-enable. Refer to the '''VSI OpenVMS RTL Library (LIB$) Manual''' for more info about LIB$CREATE_DIR. |
− | : <code>pv:int</code> protection value | + | : <code>pv:int</code>: protection-value |
;returns | ;returns | ||
− | : <code>vms.ssdef.SS__CREATED</code> one or more directories created | + | : <code>vms.ssdef.SS__CREATED</code>: one or more directories created |
− | : <code>vms.ssdef.SS__NORMAL</code> all specified directories already exist | + | : <code>vms.ssdef.SS__NORMAL</code>: all the specified directories already exist |
− | : | + | : Some other error. See in '''vms.ssdef''' |
---- | ---- | ||
=== date_time()->list === | === date_time()->list === | ||
Gets current date and time. | Gets current date and time. | ||
;parameters | ;parameters | ||
− | :<code>None</code> | + | : <code>None</code> |
;returns | ;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 | + | Allocates the local event flag. |
;parameters | ;parameters | ||
:<code>None</code> | :<code>None</code> | ||
;returns | ;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 | ;parameters | ||
− | : <code>ef:int</code> | + | : <code>ef:int</code>: local event flag |
;returns | ;returns | ||
:Status code of the operation | :Status code of the operation | ||
Line 229: | Line 295: | ||
Copies a string into the common area. | Copies a string into the common area. | ||
;parameters | ;parameters | ||
− | : <code>common:str</code> string to copy | + | : <code>common:str</code>: string to copy |
;returns | ;returns | ||
:Status code of the operation | :Status code of the operation | ||
Line 236: | Line 302: | ||
Gets the string from the common area. | Gets the string from the common area. | ||
;parameters | ;parameters | ||
− | :<code>None</code> | + | : <code>None</code> |
;returns | ;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 | ;parameters | ||
− | : <code>flags:int</code> if set to <code>1</code>, the host node name is returned in | + | : <code>flags:int</code> if set to <code>1</code>, the host node name is returned in a parseable format |
;returns | ;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 | ;parameters | ||
− | : <code>item_code:int</code> item identifier code defining the item of information to be returned. See '''vms.jpidef''' | + | : <code>item_code:int</code>: item identifier code defining the item of the information to be returned. See '''vms.jpidef''' |
− | : <code>pid:int</code> process | + | : <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 '''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 | ;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 | ;parameters | ||
− | : <code>item_code:int</code> item identifier code defining the item of information to be returned. See '''vms.syidef''' | + | : <code>item_code:int</code>: item identifier code defining the item of the information to be returned. See '''vms.syidef''' |
− | : <code>node_name:str</code> node name | + | : <code>node_name:str</code>: node name |
;returns | ;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 | + | :*<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 | ;parameters | ||
− | : <code>command:str</code> command to execute | + | : <code>command:str</code>: command to execute |
− | : <code>input_file:str</code> equivalence name to be associated with the logical name SYS$INPUT | + | : <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>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>flags:int</code>: flag bits that designate optional behavior. See '''vms.clidef''' |
− | : <code>pname:str</code> name defined for the subprocess | + | : <code>pname:str</code>: name defined for the subprocess |
;returns | ;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 | + | :*<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 | ;parameters | ||
− | : <code>command:str</code> command to execute | + | : <code>command:str</code>: command to execute |
;returns | ;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 == | ||
<br>Wraps the '''OpenVMS System Services''' functions.<br> | <br>Wraps the '''OpenVMS System Services''' functions.<br> | ||
Line 300: | Line 367: | ||
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 | ;parameters | ||
− | : <code>vms_time:int</code> OpenVMS system time. A negative time value represents a delta time. | + | : <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. | + | : <code>time_only:int</code>: if set to <code>1</code>, asctim returns the hour only. |
;returns | ;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 | ;parameters | ||
− | : <code>time_str:str</code> in format: | + | : <code>time_str:str</code> in the following format: |
− | :* Absolute Time: dd-mmm-yyyy hh:mm:ss.cc | + | :*Absolute Time: dd-mmm-yyyy hh:mm:ss.cc |
− | :* Delta Time: dddd hh:mm:ss.cc | + | :*Delta Time: dddd hh:mm:ss.cc |
;returns | ;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 | ;parameters | ||
− | : <code>name:str</code> identifier name | + | : <code>name:str</code>: identifier name |
;returns | ;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 | ;parameters | ||
− | : <code>id_val:int</code> identifier value. See '''OpenVMS System Services Reference Manual''' for SYS$IDTOASC | + | : <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 <code>0</code>. |
;returns | ;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 | ;parameters | ||
− | : <code>tmp:int</code> the first bit specifies a permanent mailbox | + | : <code>tmp:int</code>: the first bit specifies a permanent mailbox |
− | : <code>maxmsg:int</code> maximum size of a message (in bytes) | + | : <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>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>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>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>mbx_name:string</code>: logical name to be assigned to the mailbox |
− | : <code>flags:int</code> options for the assign operation. See '''vms.cmbdef''' | + | : <code>flags:int</code>: options for the assign operation. See '''vms.cmbdef''' |
;returns | ;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 | ;parameters | ||
− | : <code>channel:int</code> mailbox channel | + | : <code>channel:int</code>: mailbox channel |
;returns | ;returns | ||
:Status code | :Status code | ||
Line 366: | Line 433: | ||
Provides a process with an I/O channel. | Provides a process with an I/O channel. | ||
;parameters | ;parameters | ||
− | : <code>devnam:str</code> name of the device | + | : <code>devnam:str</code>: name of the device |
− | : <code>acmode:int</code> access mode to be associated with the channel | + | : <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>mbxnam:str</code>: logical name of the mailbox to be associated with the device |
− | : <code>flags:int</code> an optional device-specific argument | + | : <code>flags:int</code>: an optional device-specific argument |
;returns | ;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 | ;parameters | ||
− | : <code>channel:int</code> number of the I/O channel to be unassigned | + | : <code>channel:int</code>: number of the I/O channel to be unassigned |
;returns | ;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 the I/O channel. |
;parameters | ;parameters | ||
− | : <code>channel:int</code> I/O channel | + | : <code>channel:int</code>: I/O channel |
− | : <code>max_read:int</code> amount of bytes to read | + | : <code>max_read:int</code>: amount of bytes to read |
− | : <code>block:int</code> starting block | + | : <code>block:int</code>: starting block |
− | : <code>fmod:int</code> function code modifiers | + | : <code>fmod:int</code>: function code modifiers |
;returns | ;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 the I/O channel. |
;parameters | ;parameters | ||
− | : <code>channel:int</code> I/O channel | + | : <code>channel:int</code>: I/O channel |
− | : <code>buffer:bytes</code> bytes to write | + | : <code>buffer:bytes</code>: bytes to write |
− | : <code>block:int</code> starting block | + | : <code>block:int</code>: starting block |
− | : <code>fmod:int</code> function code modifiers | + | : <code>fmod:int</code>: function code modifiers |
;returns | ;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 the I/O operation. |
;parameters | ;parameters | ||
− | : <code>channel:int</code> I/O channel | + | : <code>channel:int</code>: I/O channel |
;returns | ;returns | ||
:Status code | :Status code | ||
Line 418: | Line 485: | ||
Creates a logical name and specifies its equivalence names. | Creates a logical name and specifies its equivalence names. | ||
;parameters | ;parameters | ||
− | : <code>attr:int</code> attributes to be associated with the logical name. See '''vms.lnmdef''' | + | : <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>tabnam:str</code>: name of the table in which to create the logical name |
− | : <code>lognam:str</code> logical name to be created | + | : <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>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>]] | + | : <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 | ;returns | ||
Line 430: | Line 497: | ||
Returns information about the specified logical name. | Returns information about the specified logical name. | ||
;parameters | ;parameters | ||
− | : <code>attr:int</code> attributes controlling the search for the logical name. See '''vms.lnmdef''' | + | : <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>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>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>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>]] | + | : <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 | ;returns | ||
Line 442: | Line 509: | ||
Deletes all logical names with the specified name. | Deletes all logical names with the specified name. | ||
;parameters | ;parameters | ||
− | : <code>tabnam:str</code> name of | + | : <code>tabnam:str</code>: name of a logical name table or the name of a searchlist logical name |
− | : <code>lognam:str</code> logical name to be deleted | + | : <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''' | + | : <code>acmode:int</code>: access mode to be used in the delete operation. See '''vms.psldef''' |
;returns | ;returns | ||
:Status code | :Status code | ||
Line 451: | Line 518: | ||
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 | ;parameters | ||
− | : <code>search_devnam:str</code> name of the device for which <code>device_scan</code> to search | + | : <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>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>. | + | : <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 | ;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 | ;parameters | ||
− | : <code>uic:int</code> UIC | + | : <code>uic:int</code>: UIC |
: <code>flags:int</code> | : <code>flags:int</code> | ||
− | :* <code>0</code> | + | :*<code>0</code>: use "!%I" SYS$FAO format |
− | :* <code>1</code> | + | :*<code>1</code>: use "!%U" SYS$FAO format |
;returns | ;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 | ;parameters | ||
− | : <code>dev_nam:str</code> the name of the device for which information is to be returned | + | : <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 | + | : <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 | ;returns | ||
Line 485: | Line 552: | ||
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 | ;parameters | ||
− | : <code>pid:int</code> process identification | + | : <code>pid:int</code>: process identification |
− | : <code>pnam:str</code> name of the process | + | : <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 | + | : <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 | ;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 | + | :* <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 | ;parameters | ||
− | : <code>lki:int</code> identification of the lock (lock ID) information about which needs to be returned | + | : <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 | + | : <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 | ;returns | ||
:The list: | :The list: | ||
− | :* <code>int</code> status code of the operation | + | :*<code>int</code>: status code of the operation |
− | :* <code>int</code> lock identification | + | :*<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 | ;parameters | ||
− | : <code>msgid:int</code> identification of the message to be retrieved | + | : <code>msgid:int</code>: identification of the message to be retrieved |
− | : <code>flags:int</code> message components to be returned | + | : <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 | ;returns | ||
:The list: | :The list: | ||
− | :* <code>int</code> status code of the operation | + | :* <code>int</code>: status code of the operation |
− | :* <code>str</code> message string | + | :* <code>str</code>: message string |
− | :* <code>int</code> optional information | + | :* <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 | ;parameters | ||
− | : <code>func:int</code> function code specifying the function that <code>getqui</code> is to perform. See '''vms.quidef''' | + | : <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>context:int</code>: context stream for this call |
− | : <code>item_list:object</code> item list supplying the information to be used by the function | + | : <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 | ;returns | ||
:The list: | :The list: | ||
− | :* <code>int</code> status code of the operation | + | :*<code>int</code>: status code of the operation |
− | :* <code>int</code> context | + | :*<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 | ;parameters | ||
− | : <code>item_list:object</code> item list specifying which information about the local node is to be returned | + | : <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 | ;returns | ||
Line 540: | Line 607: | ||
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 | ;parameters | ||
− | : <code>csid:int</code> OpenVMS Cluster system identification | + | : <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>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 | + | : <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 | ;returns | ||
:The list: | :The list: | ||
− | :* <code>int</code> status code of the operation | + | :*<code>int</code>: status code of the operation |
− | :* <code>int</code> | + | :*<code>int</code>: CSID |
---- | ---- | ||
=== gettim()->list === | === gettim()->list === | ||
Line 555: | Line 622: | ||
;returns | ;returns | ||
:The list: | :The list: | ||
− | :* <code>int</code> status code of the operation | + | :*<code>int</code>: status code of the operation |
− | :* <code>int</code> current system time | + | :*<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 | ;parameters | ||
− | : <code>user_name:str</code> name of the user to get authorization information for | + | : <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 | + | : <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 | ;returns | ||
Line 574: | Line 641: | ||
:Status code | :Status code | ||
---- | ---- | ||
− | === schdwk(pid:int, pname:str, time:int)->list === | + | === schdwk(pid:int, pname:str, time:int, reptim: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 | ;parameters | ||
− | : <code>pid:int</code> process identification (PID) of the process to be awakened | + | : <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>pname:str</code>: name of the process to be awakened |
− | : <code>time:int</code> time at which the process to be awakened | + | : <code>time:int</code>: time at which the process is to be awakened |
+ | : <code>reptim:int</code>: time interval at which the wakeup request is to be repeated | ||
See '''OpenVMS System Services Reference Manual''' for SYS$SCHDWK | See '''OpenVMS System Services Reference Manual''' for SYS$SCHDWK | ||
;returns | ;returns | ||
:The list: | :The list: | ||
− | :* <code>int</code> status code of the operation | + | :*<code>int</code>: status code of the operation |
− | :* <code>int</code> | + | :*<code>int</code>: PID |
---- | ---- | ||
+ | |||
=== add_holder(id:int, holder:int, attrib:int)->int === | === add_holder(id:int, holder:int, attrib:int)->int === | ||
− | Adds | + | Adds the specified holder record to the target identifier. |
;parameters | ;parameters | ||
− | : <code>id:int</code> target identifier granted to the specified holder | + | : <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>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 | + | : <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 | ;returns | ||
Line 599: | Line 668: | ||
Adds the specified identifier to the rights database. | Adds the specified identifier to the rights database. | ||
;parameters | ;parameters | ||
− | : <code>name:str</code> identifier name to be added to the rights database | + | : <code>name:str</code>: identifier name to be added to the rights database |
− | : <code>id:int</code> identifier to be created | + | : <code>id:int</code>: identifier to be created |
− | : <code>attrib:int</code> attributes placed in the identifier’s record | + | : <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 | ;returns | ||
:The list: | :The list: | ||
− | :* <code>int</code> status code of the operation | + | :*<code>int</code>: status code of the operation |
− | :* <code>int</code> <code>resid</code> | + | :*<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 | ;parameters | ||
− | : <code>holder:int</code> holder whose identifiers to be found | + | : <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 | + | : <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 | ;returns | ||
:The list: | :The list: | ||
− | :* <code>int</code> status code of the operation | + | :*<code>int</code>: status code of the operation |
− | :* <code>int</code> <code>id</code> | + | :*<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>attrib</code>: attributes associated with the holder returned in <code>id</code> |
− | :* <code>int</code> <code>context</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 | ;parameters | ||
− | : <code>context:int</code> context value to be cleared | + | : <code>context:int</code>: context value to be cleared |
;returns | ;returns | ||
:Status code | :Status code | ||
Line 631: | Line 700: | ||
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 | ;parameters | ||
− | : <code>pid:int</code> process identification (PID) of the process to force exit | + | : <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>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 | + | : <code>code:int</code>: completion code value to be used as the exit parameter |
;returns | ;returns | ||
:Status code | :Status code | ||
Line 640: | Line 709: | ||
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 | ;parameters | ||
− | : <code>id:int</code> binary value of the target identifier | + | : <code>id:int</code>: binary value of the target identifier |
− | : <code>holder:int</code> identifier of the holder being deleted | + | : <code>holder:int</code>: identifier of the holder being deleted |
;returns | ;returns | ||
:Status code | :Status code | ||
Line 648: | Line 717: | ||
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 | ;parameters | ||
− | : <code>id:int</code> binary value of the identifier deleted from rights database | + | : <code>id:int</code>: binary value of the identifier deleted from rights database |
;returns | ;returns | ||
:Status code | :Status code | ||
Line 655: | Line 724: | ||
Modifies the user authorization file (UAF) record for the specified user. | Modifies the user authorization file (UAF) record for the specified user. | ||
;parameters | ;parameters | ||
− | : <code>user_name:str</code> name of the user whose UAF record is modified | + | : <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 | + | : <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 | ;returns | ||
Line 664: | Line 733: | ||
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 | ;parameters | ||
− | : <code>user_criteria:str</code> description of an intruder or suspect | + | : <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>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 | + | : <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 | ;returns | ||
:The list: | :The list: | ||
− | :* <code>int</code> status code of the operation | + | :*<code>int</code>: status code of the operation |
− | :* <code>str</code> <code>intruder</code> | + | :*<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> | + | :*<code>int</code> <code>expires</code>: quadword time format indicating the time when the record will expire |
− | :* <code>int</code> <code>type</code> | + | :*<code>int</code> <code>type</code>: the types of the matched record and the status of the suspect |
− | :* <code>int</code> <code>count</code> | + | :*<code>int</code> <code>count</code>: number of login failures or break-in attempts |
---- | ---- | ||
== rdb == | == rdb == | ||
− | <br>Wraps the '''Oracle | + | <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 | + | Attaches to the specified database. The string may specify the full path to the Rdb database in the OpenVMS format or (more commonly) a logical name pointing to the database. |
;parameters | ;parameters | ||
− | : <code>dbname:string</code> path or logical name | + | : <code>dbname:string</code>: path or logical name |
;returns | ;returns | ||
:Status code: | :Status code: | ||
− | :* <code>0</code> success | + | :* <code>0</code>: success |
− | :* <code>-1</code> failed | + | :* <code>-1</code>: failed |
---- | ---- | ||
=== CloseCursor(cursor:object)->int === | === CloseCursor(cursor:object)->int === | ||
Closes the specified cursor. | Closes the specified cursor. | ||
;parameters | ;parameters | ||
− | : <code>cursor:object</code> cursor | + | : <code>cursor:object</code>: cursor |
;returns | ;returns | ||
:Status code: | :Status code: | ||
− | :* <code>0</code> success | + | :*<code>0</code>: success |
− | :* <code>-1</code> failed | + | :*<code>-1</code>: failed |
---- | ---- | ||
=== Commit()->int === | === Commit()->int === | ||
Line 704: | Line 773: | ||
;returns | ;returns | ||
:Status code: | :Status code: | ||
− | :* <code>0</code> success | + | :*<code>0</code>: success |
− | :* <code>-1</code> failed | + | :*<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 | ;parameters | ||
− | : <code>cursor:object</code> cursor | + | : <code>cursor:object</code>: cursor |
− | : <code>idx:int</code> index | + | : <code>idx:int</code>: index |
;returns | ;returns | ||
:Resulting string | :Resulting string | ||
Line 718: | Line 787: | ||
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 | ;parameters | ||
− | : <code>name:str</code> name for the cursor | + | : <code>name:str</code>: name for the cursor |
− | : <code>statement:str</code> SQL statement | + | : <code>statement:str</code>: SQL statement |
;returns | ;returns | ||
:Resulting cursor | :Resulting cursor | ||
Line 729: | Line 798: | ||
;returns | ;returns | ||
:Status code: | :Status code: | ||
− | :* <code>0</code> success | + | :*<code>0</code>: success |
− | :* <code>-1</code> failed | + | :*<code>-1</code>: failed |
---- | ---- | ||
=== Error()->str === | === Error()->str === | ||
Returns a description of the last error. | Returns a description of the last error. | ||
;parameters | ;parameters | ||
− | :<code>None</code> | + | : <code>None</code> |
;returns | ;returns | ||
:Resulting error string | :Resulting error string | ||
Line 742: | Line 811: | ||
Executes a previously prepared SQL statement. | Executes a previously prepared SQL statement. | ||
;parameters | ;parameters | ||
− | : <code>sh:object</code> prepared SQL statement | + | : <code>sh:object</code>: prepared SQL statement |
;returns | ;returns | ||
:Status code: | :Status code: | ||
− | :* <code>0</code> success | + | :*<code>0</code>: success |
− | :* <code>-1</code> failed | + | :*<code>-1</code>: failed |
---- | ---- | ||
=== ExecI(st:str)->int === | === ExecI(st:str)->int === | ||
Line 752: | Line 821: | ||
'''Note: the last letter is a capital 'i' | '''Note: the last letter is a capital 'i' | ||
;parameters | ;parameters | ||
− | : <code>st:str</code> SQL statement | + | : <code>st:str</code>: SQL statement |
;returns | ;returns | ||
:Status code: | :Status code: | ||
− | :* <code>0</code> success | + | :*<code>0</code>: success |
− | :* <code>-1</code> failed | + | :*<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 | ;parameters | ||
− | : <code>cursor:object</code> cursor | + | : <code>cursor:object</code>: cursor |
;returns | ;returns | ||
:Status code: | :Status code: | ||
− | :* <code>1</code> success | + | :*<code>1</code>: success |
− | :* <code>0</code> success, end of stream | + | :*<code>0</code>: success, end of stream |
− | :* <code>-1</code> failed | + | :*<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 | + | Fetches a row of data using the specified cursor handle. The fetched data is returned as a list of strings. |
;parameters | ;parameters | ||
− | : <code>cursor:object</code> cursor | + | : <code>cursor:object</code>: cursor |
;returns | ;returns | ||
:The list of strings | :The list of strings | ||
Line 778: | Line 847: | ||
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 | ;parameters | ||
− | : <code>cursor:object</code> cursor | + | : <code>cursor:object</code>: cursor |
;returns | ;returns | ||
:Status code: | :Status code: | ||
− | :* <code>0</code> success | + | :*<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 | ;parameters | ||
− | : <code>cursor:object</code> cursor | + | : <code>cursor:object</code>: cursor |
;returns | ;returns | ||
:Number of columns | :Number of columns | ||
Line 793: | Line 862: | ||
Opens a cursor using the supplied (previously declared) cursor handle. | Opens a cursor using the supplied (previously declared) cursor handle. | ||
;parameters | ;parameters | ||
− | : <code>cursor:object</code> cursor | + | : <code>cursor:object</code>: cursor |
;returns | ;returns | ||
:Status code: | :Status code: | ||
− | :* <code>0</code> success | + | :*<code>0</code>: success |
− | :* <code>-1</code> failed | + | :*<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 | ;parameters | ||
− | : <code>st:string</code> SQL statement | + | : <code>st:string</code>: SQL statement |
;returns | ;returns | ||
:Resulting prepared statement | :Resulting prepared statement | ||
Line 812: | Line 881: | ||
;returns | ;returns | ||
:Status code: | :Status code: | ||
− | :* <code>0</code> success | + | :*<code>0</code>: success |
− | :* <code>-1</code> failed | + | :*<code>-1</code>: failed |
---- | ---- | ||
=== SetReadonly()->int === | === SetReadonly()->int === | ||
Line 821: | Line 890: | ||
;returns | ;returns | ||
:Status code: | :Status code: | ||
− | :* <code>0</code> success | + | :*<code>0</code>: success |
− | :* <code>-1</code> failed | + | :*<code>-1</code>: failed |
---- | ---- | ||
=== Sqlcode()->int === | === Sqlcode()->int === | ||
Line 831: | Line 900: | ||
:Resulting SQL code | :Resulting SQL code | ||
---- | ---- | ||
− | [[Category:VMS | + | |
+ | == RMS == | ||
+ | <br>Working with RMS.<br> | ||
+ | |||
+ | It should be noted that the RMS module is intended for use with indexed RMS files only. | ||
+ | |||
+ | ---- | ||
+ | === BCD2String(bcd:bytes, prec:int)->str === | ||
+ | Converts BCD to string. | ||
+ | ;parameters | ||
+ | : <code>bcd:bytes</code>: BCD | ||
+ | : <code>prec:int</code>: precision | ||
+ | ;returns | ||
+ | : <code>str</code>: BCD number as a string | ||
+ | ---- | ||
+ | |||
+ | === String2BCD(repr:str, l:int, prec:int)->bytes === | ||
+ | Converts string to BCD. | ||
+ | ;parameters | ||
+ | : <code>repr:str</code>: string representation of the BCD number | ||
+ | : <code>l:int</code>: length | ||
+ | : <code>prec:int</code>: precision | ||
+ | ;returns | ||
+ | : <code>bytes</code>: BCD from string | ||
+ | ---- | ||
+ | |||
+ | === BCD2Tuple(bcd:bytes, prec:int)->tuple === | ||
+ | Converts BCD to tuple: (sign, (digits,), precision). | ||
+ | ;parameters | ||
+ | : <code>bcd:bytes</code>: BCD | ||
+ | : <code>prec:int</code>: precision | ||
+ | ;returns | ||
+ | : <code>tuple</code>: BCD parsed to a tuple | ||
+ | ---- | ||
+ | |||
+ | === Tuple2BCD(repr:tuple, l:int, prec:int)->bytes === | ||
+ | Converts tuple to BCD. | ||
+ | ;parameters | ||
+ | : <code>repr:tuple</code>: tuple representation of the BCD number | ||
+ | : <code>l:int</code>: length | ||
+ | : <code>prec:int</code>: precision | ||
+ | ;returns | ||
+ | : <code>bytes</code>: BCD from tuple | ||
+ | ---- | ||
+ | |||
+ | === getrmsattr(path:str, attr:int)->int === | ||
+ | Gets an RMS attribute. | ||
+ | ;parameters | ||
+ | : <code>path:str</code>: VMS path to the file | ||
+ | : <code>attr:int</code>: attribute to retrieve | ||
+ | ;returns | ||
+ | : <code>attr:int</code>: attribute value | ||
+ | ---- | ||
+ | |||
+ | === parse(path:str)->tuple === | ||
+ | Parses the VMS path to a tuple of bytes: (node, disk, directory, name, extension, version) | ||
+ | ;parameters | ||
+ | : <code>path:str</code>: VMS path to the file | ||
+ | ;returns | ||
+ | : <code>tuple</code>: parsed path | ||
+ | ---- | ||
+ | |||
+ | === file(name:str, fac:int, shr:int, fop:int)->rmsFile === | ||
+ | Opens a file | ||
+ | ;parameters | ||
+ | : <code>path:str</code>: VMS path to the file | ||
+ | : <code>fac:int</code>: file access | ||
+ | : <code>shr:int</code>: sharing options | ||
+ | : <code>fop:int</code>: file processing options | ||
+ | ;returns | ||
+ | : <code>file:rmsFile</code>: rmsFile object | ||
+ | ---- | ||
+ | |||
+ | === RMS file object === | ||
+ | |||
+ | ==== Members ==== | ||
+ | ===== longname ===== | ||
+ | Full path to the file | ||
+ | ===== nok ===== | ||
+ | Number of keys | ||
+ | ===== org ===== | ||
+ | File organization | ||
+ | ---- | ||
+ | ==== Methods ==== | ||
+ | ===== close ===== | ||
+ | close() -> status<br> | ||
+ | Closes file. | ||
+ | ---- | ||
+ | ===== delete ===== | ||
+ | delete([key]) -> status<br> | ||
+ | Deletes the current record or the first record with the given key. | ||
+ | ---- | ||
+ | ===== fetch ===== | ||
+ | fetch([key]) -> status, record<br> | ||
+ | Retrieves the record from a file. | ||
+ | ---- | ||
+ | ===== find ===== | ||
+ | find([key]) -> status<br> | ||
+ | Locates the specified record and establishes it as the current record. | ||
+ | ---- | ||
+ | ===== flush ===== | ||
+ | flush() -> status<br> | ||
+ | Writes out all modified I/O buffers and file attributes associated with the file. | ||
+ | ---- | ||
+ | ===== free ===== | ||
+ | free() -> status<br> | ||
+ | Unlocks all records that were previously locked for the record stream. | ||
+ | ---- | ||
+ | ===== put ===== | ||
+ | put(record) -> status<br> | ||
+ | Inserts a record into a file. | ||
+ | ---- | ||
+ | ===== release ===== | ||
+ | release() -> status<br> | ||
+ | Unlocks the record. | ||
+ | ---- | ||
+ | ===== rewind ===== | ||
+ | rewind([keynum]) -> status<br> | ||
+ | Sets the context of a record stream to the first record in the file. | ||
+ | ---- | ||
+ | ===== update ===== | ||
+ | update(record) -> status<br> | ||
+ | Allows to modify the contents of an existing record in a file residing on a disk device. | ||
+ | ---- | ||
+ | ===== usekey ===== | ||
+ | usekey([keynum]) -> status<br> | ||
+ | Specifies the key or index to which the operation applies. | ||
+ | ---- | ||
+ | ===== setrop ===== | ||
+ | setrop(rop) -> status<br> | ||
+ | Specifies which of the various optional record operations are to be implemented for the program. | ||
+ | ---- | ||
+ | |||
+ | =See also= | ||
+ | * {{Template:CRuntime}} | ||
+ | * {{Template:RTLLibrary}} | ||
+ | * {{Template:SyservI}} | ||
+ | * {{Template:SyservII}} | ||
+ | |||
+ | [[Category:VMS Python]] |
Latest revision as of 23:26, 6 July 2022
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
- 1.10 get_symbol(name:str)->list
- 1.11 fopen(path:str, mode:str, ...)->fp:object
- 1.12 fclose(fp:object)->status:int
- 1.13 fileno(fp:object)->fd:int
- 1.14 write(fd:int, data:bytes)->nbytes:int
- 1.15 fgets(fp:object, maxchars:int)->line:str
- 1.16 feof(fp:object)->status:int
- 1.17 ferror(fp:object)->status: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
- 4.13 trnlnm(attr:int, tabnam:str, lognam:str, acmode:int, il:object)->int
- 4.14 dellnm(tabnam:str, lognam:str, acmode:int)->int
- 4.15 device_scan(search_devnam:str, item_list:object, context:int)->list
- 4.16 uicstr(uic:int, flags:int)->list
- 4.17 getdvi(dev_nam:str, item_list:object)->int
- 4.18 getjpi(pid:int, pnam:str, item_list:object)->list
- 4.19 getlki(lki:int, item_list:object)->list
- 4.20 getmsg(msgid:int, flags:int)->list
- 4.21 getqui(func:int, context:int, item_list:object)->list
- 4.22 getrmi(item_list:object)->int
- 4.23 getsyi(csid:int, node_name:str, item_list:object)->list
- 4.24 gettim()->list
- 4.25 getuai(user_name:str, item_list:object)->int
- 4.26 hiber()->int
- 4.27 schdwk(pid:int, pname:str, time:int, reptim:int)->list
- 4.28 add_holder(id:int, holder:int, attrib:int)->int
- 4.29 add_ident(name:str, id:int, attrib:int)->list
- 4.30 find_held(holder:int, context:int)->list
- 4.31 finish_rdb(context:int)->int
- 4.32 forcex(pid:int, pname:str, code:int)->int
- 4.33 rem_holder(id:int, holder:int)->int
- 4.34 rem_ident(id:int)->int
- 4.35 setuai(user_name:str, item_list:object)->int
- 4.36 show_intrusion(user_criteria:str, flags:int, context:int)->list
- 5 rdb
- 5.1 Attach(dbname:string)->int
- 5.2 CloseCursor(cursor:object)->int
- 5.3 Commit()->int
- 5.4 Data(cursor:object, idx:int)->str
- 5.5 DeclareCursor(name:str, statement:str)->object
- 5.6 Detach()->int
- 5.7 Error()->str
- 5.8 Exec(sh:object)->int
- 5.9 ExecI(st:str)->int
- 5.10 Fetch(cursor:object)->int
- 5.11 FetchRow(cursor:object)->list
- 5.12 Free(cursor:object)->int
- 5.13 Ncol(cursor:object)->int
- 5.14 OpenCursor(cursor:object)->int
- 5.15 Prepare(st:string)->object
- 5.16 Rollback()->int
- 5.17 SetReadonly()->int
- 5.18 Sqlcode()->int
- 6 RMS
- 6.1 BCD2String(bcd:bytes, prec:int)->str
- 6.2 String2BCD(repr:str, l:int, prec:int)->bytes
- 6.3 BCD2Tuple(bcd:bytes, prec:int)->tuple
- 6.4 Tuple2BCD(repr:tuple, l:int, prec:int)->bytes
- 6.5 getrmsattr(path:str, attr:int)->int
- 6.6 parse(path:str)->tuple
- 6.7 file(name:str, fac:int, shr:int, fop:int)->rmsFile
- 6.8 RMS file object
- 7 See also
vms.decc
Wraps the C Run-Time Library for OpenVMS Systems functions.
dlopen_test(name:str)->int
Checks if a shared image can be opened and loaded into memory.
- 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 the VMS time to the Unix time stamp.
- parameters
vms_time:int
: VMS system time- returns
- Time in the Unix format (number of seconds since 01/01/1970)
from_vms(vms_path:str, wild_flag:int)->list
Converts the VMS path to a list of Unix paths.
- parameters
vms_path:str
: path in the VMS format (supports wildcards)wild_flag:int
: If set to0
, the wildcards found invms_path
are not expanded- returns
- List of paths in the Unix notation
getenv(name:str, def_value:str)->str
Gets the specified environment variable value. See getenv() description in the VSI C Run-Time Library Reference Manual for OpenVMS Systems.
- 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 before the sleep timer expires 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 the UNIX style file specifications to the OpenVMS file specifications.
- parameters
unix_path:str
: file name following the Unix file naming conventionsallow_wild:int
: If set to0
, the 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 OpenVMS style pathnames
unixtime(vms_time:int)->int
Converts the 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
get_symbol(name:str)->list
Requests the calling process’s command language interpreter (CLI) to return the value of a CLI symbol as a string.
- parameters
name:str
: Name of the symbol- returns
- The list:
int
: status code of the operationstr
: value of the returned symbol
fopen(path:str, mode:str, ...)->fp:object
Opens a file.
- parameters
path:str
: A character string containing a valid file specificationmode:str
: The access mode indicator...:str
: Optional file attribute arguments- returns
-
fp:object
: File pointer
fclose(fp:object)->status:int
Closes a file.
- parameters
fp:object
: A pointer to the file to be closed- returns
-
status:int
: status code of the operation
fileno(fp:object)->fd:int
Returns the file descriptor associated with the specified file pointer.
- parameters
fp:object
: A pointer to the file- returns
-
fd:int
: Integer file descriptor
write(fd:int, data:bytes)->nbytes:int
Writes bytes to a file.
- parameters
fd:int
: Integer file descriptordata:bytes
: Bytes to write- returns
-
nbytes:int
: The number of bytes written
fgets(fp:object, maxchars:int)->line:str
Reads a line from the specified file, up to one less than the specified maximum number of characters or up to and including the newline character, whichever comes first.
- parameters
fp:object
: A pointer to the filemaxchars:int
: The maximum number of characters to fetch- returns
-
line:str
: The fetched line
feof(fp:object)->status:int
Tests a file to see if the end-of-file has been reached.
- parameters
fp:object
: A pointer to the file- returns
-
status:int
: Nonzero integer indicates that the end-of-file has been reached
ferror(fp:object)->status:int
Returns a nonzero integer if an error occurred while reading or writing a file.
- parameters
fp:object
: A pointer to the file- returns
-
status:int
: Nonzero integer indicates that an error has occurred
vms.ile3
Provides functions to work with item lists.
new()->object
Creates an empty item list.
- parameters
None
- returns
- New empty item list
delete(il:object)->None
Deletes the item list.
- parameters
il:object
: item list to be removed- returns
None
size(il:object)->int
Gets the 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 item 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 item_value
is not None
, item_length
is ignored and the length of the buffer will be the same as the length of item_value
.
- parameters
il:object
: item listitem:int
: item to additem_value:str
: value to add (orNone
)item_length:int
: length of the buffer ifitem_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 item_value
is longer than 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 item_value
is longer than 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 item list. This item 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 (following the OpenVMS naming conventions)uic:int
: unsigned integer value of the owner UIC:None
: current user0
: owner of the parent directory
pe:int
: protection-enable. Refer to the VSI OpenVMS RTL Library (LIB$) Manual for more info about LIB$CREATE_DIR.pv:int
: protection-value- returns
vms.ssdef.SS__CREATED
: one or more directories createdvms.ssdef.SS__NORMAL
: all the specified directories already exist- Some other 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 the 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
: 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 a parseable format- 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 the 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 the 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 the following 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 value0
.- 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 the 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 the 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 the 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
trnlnm(attr:int, tabnam:str, lognam:str, acmode:int, il:object)->int
Returns information about the specified logical name.
- parameters
attr:int
: attributes controlling the search for the logical name. See vms.lnmdeftabnam:str
: name of the logical name table or the name of a searchlist logical namelognam:str
: logical name for which information is to be returnedacmode:int
: access mode to be used in the translation. See vms.psldefil:object
: item 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:str
: name of a logical name table or the name of a searchlist logical namelognam:str
: logical name to be deletedacmode:int
: access 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:str
: name of the device for whichdevice_scan
to searchitem_list:object
: item list specifying search criteriacontext:int
: value 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:
int
: status code of the operationstr
: found device nameint
: context
uicstr(uic:int, flags:int)->list
Converts UIC to a string.
- parameters
uic:int
: UICflags:int
0
: use "!%I" SYS$FAO format1
: use "!%U" SYS$FAO format
- returns
- The list:
int
: status code of the operationstr
: UIC 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:str
: the name of the device for which information is to be returneditem_list:object
: item 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:int
: process identificationpnam:str
: name of the processitem_list:object
: item 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:
int
: status code of the operationint
: process ID
getlki(lki:int, item_list:object)->list
Returns information about the lock database on a system.
- parameters
lki:int
: identification of the lock (lock ID) information about which needs to be returneditem_list:object
: item list specifying the lock information to be returned
See OpenVMS System Services Reference Manual for SYS$GETLKI
- returns
- The list:
int
: status code of the operationint
: lock identification
getmsg(msgid:int, flags:int)->list
Returns message text associated with a given message identification code.
- parameters
msgid:int
: identification of the message to be retrievedflags:int
: message components to be returned
See OpenVMS System Services Reference Manual for SYS$GETMSG
- returns
- The list:
int
: status code of the operationstr
: message stringint
: optional information
getqui(func:int, context:int, item_list:object)->list
Returns information about queues and the jobs initiated from these queues.
- parameters
func:int
: function code specifying the function thatgetqui
is to perform. See vms.quidefcontext:int
: context stream for this callitem_list:object
: item list supplying the information to be used by the function
See OpenVMS System Services Reference Manual for SYS$GETQUI
- returns
- The list:
int
: status code of the operationint
: context
getrmi(item_list:object)->int
Returns system performance information about the local system.
- parameters
item_list:object
: item 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:int
: OpenVMS Cluster system identificationnode_name:str
: name of the node about which information is to be returneditem_list:object
: item list specifying which information about the node or nodes to return
See OpenVMS System Services Reference Manual for SYS$GETSYI
- returns
- The list:
int
: status code of the operationint
: CSID
gettim()->list
Returns the current system time in a 64-bit format.
- parameters
None
- returns
- The list:
int
: status code of the operationint
: current system time
getuai(user_name:str, item_list:object)->int
Returns authorization information about the specified user.
- parameters
user_name:str
: name of the user to get authorization information foritem_list:object
: item 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, reptim:int)->list
Schedules the awakening (restart) of a process that has placed itself in the state of hibernation with the Hibernate service.
- parameters
pid:int
: process identification (PID) of the process to be awakenedpname:str
: name of the process to be awakenedtime:int
: time at which the process is to be awakenedreptim:int
: time interval at which the wakeup request is to be repeated
See OpenVMS System Services Reference Manual for SYS$SCHDWK
- returns
- The list:
int
: status code of the operationint
: PID
add_holder(id:int, holder:int, attrib:int)->int
Adds the specified holder record to the target identifier.
- parameters
id:int
: target identifier granted to the specified holderholder:int
: holder identifier that is granted access to the target identifierattrib:int
: attributes 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:str
: identifier name to be added to the rights databaseid:int
: identifier to be createdattrib:int
: attributes placed in the identifier’s record
See OpenVMS System Services Reference Manual for SYS$ADD_IDENT
- returns
- The list:
int
: status code of the operationint
resid
: identifier value assigned by the system
find_held(holder:int, context:int)->list
Returns the identifiers held by the specified holder.
- parameters
holder:int
: holder whose identifiers to be foundcontext:int
: context value used whenfind_held
is called repeatedly
See OpenVMS System Services Reference Manual for SYS$FIND_HELD
- returns
- The list:
int
: status code of the operationint
id
: identifier value that was foundint
attrib
: attributes associated with the holder returned inid
int
context
finish_rdb(context:int)->int
Deallocates the record stream and clears the context value.
- parameters
context:int
: context 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:int
: process identification (PID) of the process to force exitpname:str
: process name of the process that is to force exitcode:int
: completion 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:int
: binary value of the target identifierholder:int
: identifier 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:int
: binary 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:str
: name of the user whose UAF record is modifieditem_list:object
: item 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:str
: description of an intruder or suspectflags:int
: type of records in the intrusion database about which information is to be returned. NOTE: do not use vms.ciadef.CIA_M_ITEMLIST, becauseuser_criteria
is a stringcontext:int
: context information to keep between related calls
See OpenVMS System Services Reference Manual for SYS$SETUAI
- returns
- The list:
int
: status code of the operationstr
intruder
: user specification of the matched intruder or suspect record in the intrusion databaseint
expires
: quadword time format indicating the time when the record will expireint
type
: the types of the matched record and the status of the suspectint
count
: 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 the OpenVMS format or (more commonly) a logical name pointing to the database.
- parameters
dbname:string
: path or logical name- returns
- Status code:
0
: success-1
: failed
CloseCursor(cursor:object)->int
Closes the specified cursor.
- parameters
cursor:object
: cursor- returns
- Status code:
0
: success-1
: failed
Commit()->int
Commits the current database transaction.
- parameters
None
- returns
- Status code:
0
: success-1
: failed
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:object
: cursoridx:int
: index- 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:str
: name for the cursorstatement:str
: SQL statement- returns
- Resulting cursor
Detach()->int
Disconnects from the database.
- parameters
None
- returns
- Status code:
0
: success-1
: failed
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:object
: prepared SQL statement- returns
- Status code:
0
: success-1
: failed
ExecI(st:str)->int
Executes the supplied SQL statement immediately.
Note: the last letter is a capital 'i'
- parameters
st:str
: SQL statement- returns
- Status code:
0
: success-1
: failed
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:object
: cursor- returns
- Status code:
1
: success0
: success, end of stream-1
: failed
FetchRow(cursor:object)->list
Fetches a row of data using the specified cursor handle. The fetched data is returned as a list of strings.
- parameters
cursor:object
: cursor- 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:object
: cursor- returns
- Status code:
0
: success
Ncol(cursor:object)->int
Returns the number of columns (values) that would be returned by a fetch for the specified cursor.
- parameters
cursor:object
: cursor- returns
- Number of columns
OpenCursor(cursor:object)->int
Opens a cursor using the supplied (previously declared) cursor handle.
- parameters
cursor:object
: cursor- returns
- Status code:
0
: success-1
: failed
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:string
: SQL statement- returns
- Resulting prepared statement
Rollback()->int
Rolls back the current database transaction.
- parameters
None
- returns
- Status code:
0
: success-1
: failed
SetReadonly()->int
Starts a read-only transaction.
- parameters
None
- returns
- Status code:
0
: success-1
: failed
Sqlcode()->int
Returns the SQLCODE for the last database operation.
- parameters
None
- returns
- Resulting SQL code
RMS
Working with RMS.
It should be noted that the RMS module is intended for use with indexed RMS files only.
BCD2String(bcd:bytes, prec:int)->str
Converts BCD to string.
- parameters
bcd:bytes
: BCDprec:int
: precision- returns
str
: BCD number as a string
String2BCD(repr:str, l:int, prec:int)->bytes
Converts string to BCD.
- parameters
repr:str
: string representation of the BCD numberl:int
: lengthprec:int
: precision- returns
bytes
: BCD from string
BCD2Tuple(bcd:bytes, prec:int)->tuple
Converts BCD to tuple: (sign, (digits,), precision).
- parameters
bcd:bytes
: BCDprec:int
: precision- returns
tuple
: BCD parsed to a tuple
Tuple2BCD(repr:tuple, l:int, prec:int)->bytes
Converts tuple to BCD.
- parameters
repr:tuple
: tuple representation of the BCD numberl:int
: lengthprec:int
: precision- returns
bytes
: BCD from tuple
getrmsattr(path:str, attr:int)->int
Gets an RMS attribute.
- parameters
path:str
: VMS path to the fileattr:int
: attribute to retrieve- returns
attr:int
: attribute value
parse(path:str)->tuple
Parses the VMS path to a tuple of bytes: (node, disk, directory, name, extension, version)
- parameters
path:str
: VMS path to the file- returns
tuple
: parsed path
file(name:str, fac:int, shr:int, fop:int)->rmsFile
Opens a file
- parameters
path:str
: VMS path to the filefac:int
: file accessshr:int
: sharing optionsfop:int
: file processing options- returns
file:rmsFile
: rmsFile object
RMS file object
Members
longname
Full path to the file
nok
Number of keys
org
File organization
Methods
close
close() -> status
Closes file.
delete
delete([key]) -> status
Deletes the current record or the first record with the given key.
fetch
fetch([key]) -> status, record
Retrieves the record from a file.
find
find([key]) -> status
Locates the specified record and establishes it as the current record.
flush
flush() -> status
Writes out all modified I/O buffers and file attributes associated with the file.
free
free() -> status
Unlocks all records that were previously locked for the record stream.
put
put(record) -> status
Inserts a record into a file.
release
release() -> status
Unlocks the record.
rewind
rewind([keynum]) -> status
Sets the context of a record stream to the first record in the file.
update
update(record) -> status
Allows to modify the contents of an existing record in a file residing on a disk device.
usekey
usekey([keynum]) -> status
Specifies the key or index to which the operation applies.
setrop
setrop(rop) -> status
Specifies which of the various optional record operations are to be implemented for the program.