New CI Commands [ COMMUNICATOR 3000 MPE MPE/iX RELEASE 4.5 ] MPE/iX Communicators
COMMUNICATOR 3000 MPE MPE/iX RELEASE 4.5
New CI Commands
by Rajesh Lalwani
Commercial Systems Division
PRODUCT OVERVIEW
This version of MPE/iX provides hierarchical directory structure. You
will now be able to create hierarchical directories, change the current
working directory, and purge a directory. Also, it will be possible to
look at the disk space used by such directories. This article introduces
the four new CI commands: NEWDIR, CHDIR, PURGEDIR, and DISKUSE that
accomplish the above tasks.
BACKGROUND
Please read the article "New Hierarchical File System" in this
Communicator, which provides the necessary background information such as
hierarchical directory structure, current working directory (CWD), and
name servers. Please refer to the following figure for all the examples:
/
|
+--------------------------+--------------------------+
| | |
PAYROLL DEVELOP users
| | |
+------+------+ +-------------+------------+ +--------+--+
| | | | | |
JAN92 FEB92 MPE PX bruna jeff
| | |
+--+--+ +------+------+-----+ +---+---+
| | | | | | | |
HOURS TAXINFO ledger payable data PRGFILE bin addr_bk
| |
+--+---+ +---+-----+
| | | |
main.c Makefile my_ls down_load
CREATING A DIRECTORY
Directories can be created directly below the root, another directory, or
a group. Note that in MPE/iX Release 4.5, a directory cannot be created
directly below an account. To be able to create a new directory under a
node, the user must have CD (Create Directory) access to that node. A
new CI command NEWDIR can be used to create a new directory. For
example, if a user logged on as follows:
:hello ledger,engineer/does.develop/ment,px
the directory ledger could have been originally created by the following
CI command:
:newdir /DEVELOP/PX/ledger
Notice that the account name and the group name are in upper case because
the HFS name server (which is invoked by the MPE-escape name server
because of the leading slash) does not upshift the name. An alternate
way of doing the same thing is to issue the command as follows:
:newdir ./ledger
The beginning dot is used to escape to the HFS name server. Since the
name does not begin with a slash, it is CWD relative and refers
to CWD/./ledger which is equivalent to /DEVELOP/PX/./ledger or
/DEVELOP/PX/ledger. When the user logs on, the CWD is the same as the
logon group. This can be changed as we will see shortly. Let us see
what is wrong with the following:
:comment example of doing it incorrectly
:newdir ledger
The above command looks good initially. But it does not do what we
intended to do. Since the name does not begin with dot or slash, the
name server used is MPE name server. Since it always upshifts the name,
a directory called LEDGER is created in the CWD (which is the logon
group). Finally, let us see what is wrong with the following:
:comment will give error
:newdir ./a_long_directory_name
Normally, HFS names can be as long as 255 characters, but since we are
creating a directory directly below a group, it can have a maximum of 16
characters. Only files and directories directly below a directory can
have longer names.
Changing Current Working Directory
If the above user ENGINEER.DEVELOP wants to work in the ledger directory
under the group PX, the CWD can be changed as follows:
:chdir ./ledger
The new CHDIR command allows a user to change the CWD of the CI process.
Of course, all the children processes created by CI, initially inherit
the same CWD. Another way of doing the same is as follows:
:chdir /DEVELOP/PX/ledger
It is possible to change the CWD to any directory as long as the user has
proper access. If the user ENGINEER.DEVELOP has TD (Traverse Directory)
access to the root (/) and users directories, the following command will
change the CWD to /users/jeff.
:chdir /users/jeff
Purging a Directory
MPE/iX provides a new command PURGEDIR to purge a directory. Let us
assume that the user has just logged on as follows:
:hello ledger,engineer/does.develop/ment,px
The user can purge the directory payable as follows:
:purgedir ./payable
However, the following command will not succeed:
:comment will not succeed
:purgedir ./ledger
The above command does not succeed because the directory ledger is not
empty - it has two files main.c and Makefile under it. If the user
really wants to purge the directory ledger and everything below it, the
following command should be used instead:
:purgedir ./ledger;tree
Finally, the following command will not succeed because PURGEDIR cannot
be used to purge accounts and groups:
:comment will not succeed
:purgedir /PAYROLL/JAN92
REPORTING DISK SPACE USAGE
MPE/iX Release 4.5 provides a new CI command DISKUSE to report the disk
space usage of directories, groups, and accounts. For example, if you
wanted to see the total disk space used by the entire directory
structure, issue the following command:
:diskuse /
The above command will show the total space used by the root directory
and everything below it. It breaks it up further to show the disk space
used by each directory node. If you did not want to see the disk space
used by each directory and wanted to see just the grand total, use the
following command:
:diskuse /;notree
Finally, if you just wanted to see the disk space used by all the groups
in the account DEVELOP, and their total (which will not include the disk
space used by the account node DEVELOP itself), issue the following
command:
:diskuse /DEVELOP/@;tree
SOME USEFUL UDCs
This release of MPE/iX also contains some useful UDCs in the Fundamental
Operating System (FOS). These UDCs are provided for the convenience of
users on the system. These are not enabled by default. To enable them,
do the following:
1. Logon with SM capability (MANAGER.SYS)
2. :SETCATALOG HPPXUDC.PUB.SYS;SYSTEM;APPEND
3. Relogon to activate them.
Here is the list of the UDCs and a brief description of what each UDC
does:
FINDDIR This UDC searches for a directory.
It is an interface to the LISTFILE command.
FINDFILE This UDC searches for a file.
It is an interface to the LISTFILE command.
LISTDIR This UDC lists all files which are directories.
It is an interface to the LISTFILE command.
LISTF Lists file names using both MPE and HFS syntax
unlike the LISTF command which accepts only
MPE syntax. It is an interface to the LISTFILE
command.
SH Invokes the MPE/iX Shell with the -L option.
-L causes the shell to read the environment
initialization files.
MISCELLANEOUS ENHANCEMENTS
All MPE/iX CI error message text is now generated in mixed case, rather
than only in all uppercase as in the past. This enhancement provides
more readable error messages. This change may have an effect on
third-party software that examine these messages.
ADDITIONAL INFORMATION
For more information consult the MPE/iX Reference Supplement
(32650-90353).
MPE/iX Communicators