VMS-Specific Python Modules: Difference between revisions
No edit summary |
No edit summary |
||
| Line 200: | Line 200: | ||
* <code>vms.ssdef.SS__NORMAL</code> all specified directories already exist | * <code>vms.ssdef.SS__NORMAL</code> all specified directories already exist | ||
* another error. See in '''vms.ssdef''' | * another error. See in '''vms.ssdef''' | ||
=== date_time()->list === | |||
Gets current date and time. | |||
==== parameters ==== | |||
<code>None</code> | |||
==== returns ==== | |||
The list: | |||
* <code>int</code> status code of the operation | |||
* <code>str</code> resulting string | |||
=== get_ef()->list === | |||
Allocates a local event flag. | |||
==== parameters ==== | |||
<code>None</code> | |||
==== returns ==== | |||
The list: | |||
* <code>int</code> status code of the operation | |||
* <code>int</code> resulting event flag | |||
=== free_ef(ef:int)->int === | |||
Releases the local event flag. | |||
==== parameters ==== | |||
* <code>ef:int</code> the local event flag | |||
==== returns ==== | |||
Status code of the operation | |||
=== put_common(common:str)->int === | |||
Copies a string into the common area. | |||
==== parameters ==== | |||
* <code>common:str</code> string to copy | |||
==== returns ==== | |||
Status code of the operation | |||
=== get_common()->list === | |||
Gets the string from the common area. | |||
==== parameters ==== | |||
<code>None</code> | |||
==== returns ==== | |||
The list: | |||
* <code>int</code> status code of the operation | |||
* <code>str</code> resulting string | |||
=== get_hostname(flags:int)->list === | |||
Gets the host name of the local system. | |||
==== parameters ==== | |||
* <code>flags:int</code> if set to <code>1</code>, the host node name is returned in the parsable form | |||
==== returns ==== | |||
The list: | |||
* <code>int</code> status code of the operation | |||
* <code>str</code> resulting host node name | |||
=== getjpi(item_code:int, pid:int, pname:str)->list === | |||
Gets the specified job/process information as a string. | |||
==== parameters ==== | |||
* <code>item_code:int</code> item identifier code defining the item of information to be returned. See '''vms.jpidef''' | |||
* <code>pid:int</code> process id | |||
* <code>pname:str</code> process name | |||
For valid combination of the values of <code>pid</code> and <code>pname</code> see the '''HP OpenVMS RTL Library(LIB$) Manual''' for LIB$GETJPI. The resulting <code>pid</code> is not returned. | |||
==== returns ==== | |||
The list: | |||
* <code>int</code> status code of the operation | |||
* <code>str</code> resulting string | |||
=== getsyi(item_code:int, node_name:str)->list === | |||
Gets system wide information as a string. | |||
==== parameters ==== | |||
* <code>item_code:int</code> item identifier code defining the item of information to be returned. See '''vms.syidef''' | |||
* <code>node_name:str</code> node name | |||
==== returns ==== | |||
The list: | |||
* <code>int</code> status code of the operation | |||
* <code>str</code> resulting string | |||
* <code>int</code> 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 ==== | |||
* <code>command:str</code> command to execute | |||
* <code>input_file:str</code> equivalence name to be associated with the logical name SYS$INPUT | |||
* <code>output_file:str</code> equivalence name to be associated with the logical name SYS$OUTPUT | |||
* <code>flags:int</code> flag bits that designate optional behavior. See '''vms.clidef''' | |||
* <code>pname:str</code> name defined for the subprocess | |||
==== returns ==== | |||
The list: | |||
* <code>int</code> status code of the operation | |||
* <code>int</code> 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 ==== | |||
* <code>command:str</code> command to execute | |||
==== returns ==== | |||
If successful, it does not return control to the calling program. | |||
== vms.sys == | == vms.sys == | ||
== rdb == | == rdb == | ||
Revision as of 06:21, 31 August 2020
VMS specific Python modules.
vms.decc
Provides DECC functionality.
dlopen_test(name:str)->int
Tries to open a shared image.
parameters
name:strpath to the shared image
returns
1if the shared image exists and can be opened by dlopen()0otherwise
fix_time(vms_time:int)->int
Converts VMS time to the Unix time.
parameters
vms_time:intVMS system time
returns
Time in Unix format (seconds that have elapsed since 1970.01.01)
from_vms(vms_path:str, wild_flag:int)->list
Converts VMS path to a list of Unix paths.
parameters
vms_path:strpath in VMS format (supports wildcards)wild_flag:intIf set to0, wildcards found in thevms_pathare not expanded
returns
List of paths in Unix format
getenv(name:str, def_value:str)->str
Gets the specified environment variable value. See getenv() description in the HP C Run-Time Library Reference Manual for OpenVMS Systems documentation.
parameters
name:strname of the environment variabledef_value:strdefault value
returns
Environment variable value
sleep(seconds:int)->int
Suspends execution of the current process or thread for the specified number of seconds.
parameters
seconds:intseconds to sleep
returns
The number of seconds left to the end of the sleep period if sleep is interrupted.
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:intsystem variable to be queried
returns
Requested value
to_vms(unix_path:str, allow_wild:int, no_directory:int)->list
Converts UNIX style file specifications to OpenVMS file specifications.
parameters
unix_path:strfile name in UNIX style file specification formatallow_wild:intIf set to0, wildcards found inunix_pathare not expandedno_directory:intAn integer that has one of the following values:- 0 - Directory allowed
- 1 - Prevent expansion of the string as a directory name
- 2 - Force expansion of the string as a directory name
returns
List of paths in OpenVMS style
unixtime(vms_time:int)->int
Converts OpenVMS system time to the Unix local time.
parameters
vms_time:intOpenVMS system time
returns
Unix time
vmstime(unix_time:int)->int
Converts Unix time to the OpenVMS system time.
parameters
unix_time:intUnix time
returns
OpenVMS system time
vms.ile3
Provides functions for working with list.
new()->object
Creates empty item list.
parameters
None
returns
New empty item list
delete(il:object)->None
Deletes item list.
parameters
il:objectitem list to be removed
returns
OpenVMS system time
size(il:object)->int
Gets size of the item list.
parameters
il:objectitem list
returns
The size of the specified item list
addint(il:object, item:int, item_type:int, item_value:int)->None
Adds a new integer to the item list.
parameters
il:objectitem listitem:intitem to additem_type:inttype of the item. See vms.dscdefitem_value:intvalue of the item
returns
None
getint(il:object, index:int)->int
Gets the integer at the specified index in the list.
parameters
il:objectitem listindex:intindex of the item to get
returns
Integer value
gethex(il:object, index:int)->str
Gets the integer at the specified index in the item list and returns it as a hexadecimal string.
parameters
il:objectitem listindex:intindex of the item to get
returns
Hexadecimal string
addstr(il:object, item:int, item_value:str, item_length:int)->None
Adds the specified string to the item list. If the item_value is not None, the item_length is ignored and the length of the buffer will be the same as the length of the item_value.
parameters
il:objectitem listitem:intitem to additem_value:strvalue to add (orNone)item_length:intlength of the buffer if theitem_valueisNone
returns
None
addstrd(il:object, item:int, item_value:str, item_length:int)->None
Adds the specified space-expanded string to the item list. The first byte of the buffer is the length of the string. If the item_value is longer than the item_length, it will be truncated.
parameters
il:objectitem listitem:intitem to additem_value:strvalue to additem_length:intlength of the buffer (the resulting string length is one byte less)
returns
None
addstrn(il:object, item:int, item_value:str, item_length:int)->None
Adds the specified space-expanded string to the item list. If the item_value is longer than the item_length, it will be truncated.
parameters
il:objectitem listitem:intitem to additem_value:strvalue to additem_length:intlength of the buffer
returns
None
getstr(il:object, index:int, flag:int)->str
Gets the string at the specified index in the item list.
parameters
il:objectitem listindex:intindex of the item to getflag:intif set to1, the first byte of the resulting string is the length of the string
returns
String
addbin(il:object, item:int, item_value:int, item_offset:int, item_len:int)->None
Adds a new binary item to the list. It will be interpreted as a string.
parameters
il:objectitem listitem:intitem to additem_value:intvalue to storeitem_offset:intstarting byteitem_len:intamount of bytes
returns
None
getbyte(il:object, index:int, item_offset:int)->int
Gets the byte at the specified position in the item list.
parameters
il:objectitem listindex:intindex of the itemitem_offset:intstarting byte
returns
Integer value of the specified byte
vms.lib
Provides functions from LIB$.
create_dir(name:str, uic:int, pe:int, pv:int)->int
Creates a directory.
parameters
name:strname of the directory to be created (specified in OpenVMS style)uic:intunsigned integer value of the owner UIC:None- the current user0- owner of the parent directory
pe:intprotection enable. See full documentation in the HP OpenVMS RTL Library(LIB$) Manual for LIB$CREATE_DIR.pv:intprotection value
returns
vms.ssdef.SS__CREATEDone or more directories createdvms.ssdef.SS__NORMALall specified directories already exist- another error. See in vms.ssdef
date_time()->list
Gets current date and time.
parameters
None
returns
The list:
intstatus code of the operationstrresulting string
get_ef()->list
Allocates a local event flag.
parameters
None
returns
The list:
intstatus code of the operationintresulting event flag
free_ef(ef:int)->int
Releases the local event flag.
parameters
ef:intthe local event flag
returns
Status code of the operation
put_common(common:str)->int
Copies a string into the common area.
parameters
common:strstring to copy
returns
Status code of the operation
get_common()->list
Gets the string from the common area.
parameters
None
returns
The list:
intstatus code of the operationstrresulting string
get_hostname(flags:int)->list
Gets the host name of the local system.
parameters
flags:intif set to1, the host node name is returned in the parsable form
returns
The list:
intstatus code of the operationstrresulting host node name
getjpi(item_code:int, pid:int, pname:str)->list
Gets the specified job/process information as a string.
parameters
item_code:intitem identifier code defining the item of information to be returned. See vms.jpidefpid:intprocess idpname:strprocess name
For valid combination of the values of pid and pname see the HP OpenVMS RTL Library(LIB$) Manual for LIB$GETJPI. The resulting pid is not returned.
returns
The list:
intstatus code of the operationstrresulting string
getsyi(item_code:int, node_name:str)->list
Gets system wide information as a string.
parameters
item_code:intitem identifier code defining the item of information to be returned. See vms.syidefnode_name:strnode name
returns
The list:
intstatus code of the operationstrresulting stringintresulting cluster system id
spawn(command:str, input_file:str, output_file:str, flags:int, pname:str)->list
Requests the command language interpreter (CLI) of the calling process to spawn a subprocess for executing CLI commands.
parameters
command:strcommand to executeinput_file:strequivalence name to be associated with the logical name SYS$INPUToutput_file:strequivalence name to be associated with the logical name SYS$OUTPUTflags:intflag bits that designate optional behavior. See vms.clidefpname:strname defined for the subprocess
returns
The list:
intstatus code of the operationintprocess id of the spawned process
do_command(command:str)->None
Stops program execution and directs the command language interpreter (CLI) to execute a command that is supplied as the argument.
parameters
command:strcommand to execute
returns
If successful, it does not return control to the calling program.