(LOGO.JPG) Python for OpenVMS

(go to: table of contents, index, list of vms_sys, prev: CRELNM, next: CREPRC)


CRELNT - Create Logical Name Table


Creates a process-private or shareable logical name table.

Format:

    status, resnam = vms_sys.crelnt ([attr] ,[quota] \
                    ,[promsk] ,[tabnam] ,partab ,[acmode])
Returns:
status
The binary equivalent of the following condition values can be returned:
SS$_NORMAL
The logical name table already exists.
SS$_LNMCREATED
The logical name table was created.
SS$_SUPERSEDE
The logical name table was created and its logical name superseded already existing logical names in the directory table.
All other condition codes result in a Python exception.
resnam
Name of the newly created logical name table, returned by $CRELNT.
Arguments:
attr
Attributes for the creation of the logical name table and to be associated with that table. See the system services reference manual for details. Bitmask values (LNM_M_name) are available in module 'vms_lnmdef'.
quota
Maximum number of bytes to be allocated for logical names in this table. WARNING: Specifying 0 or None means unlimited quota!
promsk
UIC-based protection mask for the logical name table. This is a Python int, but the interface limits its size to 16 bit. See the system services reference manual for details how to construct the mask.
tabnam
Name for the logical name table to be created. If None is specified, the system creates an artifical name that is returned in 'resnam'.
partab
Name of the parent logical name table.
acmode
Access mode that is to be associated with the logical name table. Normally, the access mode is 'maximized'. Because the interface runs in USER mode the logical name table would normally get this mode.

If the process has SYSNAM privilege, any access mode can be specified!

Examples:
>>> import vms_sys
>>> import vms_lnmdef

-- need to create non-shared logical name tables in supervisor mode
   because a user mode table is deleted after image rundown

$ set PROCESS /PRIVILEGE= SYSNAM
>>> PSL_C_SUPER = 2
>>> status, resnam = vms_sys.crelnt (vms_lnmdef.LNM_M_CONFINE, \
...                  123, None, 'NEW_TABLE', 'LNM$PROCESS_DIRECTORY', \
...                  PSL_C_SUPER)
>>> status, resnam
(1713, 'NEW_TABLE')
>>>
>>> vms_sys.getmsg (status)[0]
'%SYSTEM-S-LNMCREATED, logical name table did not exist; has been created'
>>>
>>> import sys
>>> sys.exit(1)        # image rundown

$ write sys$output f$message(65537)
%RMS-S-NORMAL, normal successful completion
$ show logical N* /table=LNM$PROCESS_DIRECTORY /full

(LNM$PROCESS_DIRECTORY) [kernel]  [directory]
                        [no protection information]

  "NEW_TABLE" [super,confine,table] = "" [terminal]
$ show logical /table=NEW_TABLE /full

(NEW_TABLE)     [super]  [Quota=(123,123)]
                [no protection information]
%SHOW-S-NOTRAN, no translation for logical name *
$

----------------------------------------

-- create a shareable logical name table

$ set PROCESS /PRIVILEGE= SYSNAM
>>> PSL_C_EXEC = 1
>>> status, resnam = vms_sys.crelnt (vms_lnmdef.LNM_M_NO_ALIAS, \
...                  123, None, 'NEW_TABLE_S', 'LNM$SYSTEM_DIRECTORY', \
...                  PSL_C_EXEC)
>>> status, resnam
(1713, 'NEW_TABLE_S')
>>>
>>> vms_sys.getmsg (status)[0]
'%SYSTEM-S-LNMCREATED, logical name table did not exist; has been created'
>>>
>>> import sys
>>> sys.exit(1)        # image rundown

$ write sys$output f$message(65537)
%RMS-S-NORMAL, normal successful completion
$ show logical N* /table=LNM$SYSTEM_DIRECTORY /full

(LNM$SYSTEM_DIRECTORY)  [kernel]  [shareable,directory]
                        [Protection=(RWC,RWC,R,R)]  [Owner=[G1,SYSTEM]]

  "NEW_TABLE_S" [exec,no_alias,table] = "" [terminal]

$ show logical /table=NEW_TABLE_S /full

(NEW_TABLE_S)   [exec]  [shareable]  [Quota=(123,123)]
                [Protection=(RW,RW,R,R)]  [Owner=[HOME,ZESSIN]]
%SHOW-S-NOTRAN, no translation for logical name *
$

----------------------------------------

@@ more examples for CRELNT

(go to: table of contents, index, list of vms_sys, prev: CRELNM, next: CREPRC)

17-OCT-1998 ZE.