New Hierarchical File System [ COMMUNICATOR 3000 MPE MPE/iX RELEASE 4.5 ] MPE/iX Communicators
COMMUNICATOR 3000 MPE MPE/iX RELEASE 4.5
New Hierarchical File System
by Rajesh Lalwani
Commercial Systems Division
PRODUCT OVERVIEW
This version of MPE/iX provides hierarchical directory structure. Now
you can create hierarchical directories and place other hierarchical
directories and files under them. MPE/iX also supports byte stream
files. Also, the file names can contain some special characters and they
can be as long as 255 characters. This article describes the new
hierarchical file ystem (HFS) and some limitations for MPE/iX Release
4.5.
HIERARCHICAL DIRECTORY STRUCTURE
The MPE operating system had been designed primarily for use in a
department etting. All the users in a particular department are
typically grouped together and placed in one account. Similarly, an
account, such as PAYROLL, could organize its files in groups such as
JAN92, FEB92, and so on. In this model, the directory tree consists of
one or more accounts, with each account containing one or more groups.
Finally, each group has zero or more files in it. Hence, this
file.group.account structure can be looked at as a 3-level hierarchical
structure. The first level has account entries, the econd level group
entries, and the third level the actual files. POSIX, however, has an
expanded version of MPE hierarchy. The POSIX directory tructure has a
root directory, which is represented by a slash (/). The root directory
may have files and directories under it. The directories, in turn, have
files and directories under them. MPE/iX has integrated the MPE and
POSIX concepts resulting in the new HFS. A typical MPE/iX directory could
look like:
/
|
+--------------------------+--------------------------+
| | |
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
Figure 1. An Example of a Typical MPE/iX Directory
On MPE/iX, the root directory may contain files, directories, and
accounts. For most purposes, accounts and groups are treated as
directories but there are differences. For example, groups and accounts
cannot be purged by the PURGEDIR command. Also, groups and accounts
contain some accounting information associated with them which is not the
case with HFS directories.
Like any MPE system, the accounts contain groups. The groups can, in
turn, contain files or directories. In Figure 1, three different flavors
of the integration of MPE and POSIX concepts can be seen. PAYROLL
account has not used any of the new features of POSIX. The account
PAYROLL contains two groups JAN92 and FEB92. The group FEB92 contains
just two files HOURS and TAXINFO. Notice that the files in the group
FEB92 even have valid MPE names. It seems a person familiar with UNIX
has created the directory users under the root directory. This person
has placed two directories, bruna and jeff under users. The directory
jeff has a simple file addr_bk and a directory bin under it. The
directory bin has two script files my_ls and down_load.
The person using the DEVELOP account has really used both MPE and POSIX
concepts. The account DEVELOP has two groups MPE and PX in it. This
account is apparently used by an application developer. There are two
directories, ledger and payable, probably for keeping source and make
files related to the two modules of the accounting package. The whole
application, after compilation and linking, has been kept in the file
PRGFILE. Apparently, this package keeps the data in the file data.
Here are the highlights of the MPE/iX directory structure:
* The root directory (represented by a slash /) can have accounts,
directories, or files under it.
* The accounts have groups. Note that accounts cannot have files or
directories directly below them in MPE/iX Release 4.5.
* The groups can have files or directories under them.
* All directories can have files or directories under them.
* Only accounts and groups must have valid MPE names. All others
objects can use the portable HFS character set that consists of
A-Z, a-z, 0-9, and three pecial characters ., _, and -. No name
can start with a hyphen (-).
* All names directly below the root, account, and group directories
can be at most 16 characters in length (except account and group
names that must be valid MPE names). All other names can be 255
characters long.
* In MPE/iX Release 4.5, only the program files residing in an MPE
group and having a valid MPE name can be RUN.
Current Working Directory
For HFS name server (refer to the following decription on Name Server),
MPE/iX uses two new references: current working directory (CWD) and root
directory. It is important to know that these references are defined for
each process. Thus, two processes in a single session can have two
different CWDs. If a pathname begins with a slash, the predecessor of
the first filename in the pathname is the root directory of the process.
Such names are referred to as absolute pathnames. For example,
/users/jeff/bin/my_ls is an absolute pathname. However, if the pathname
does not begin with a slash, the predecessor of the first filename of the
pathname is the CWD of the process. Such names are referred to as
relative pathnames. bin/my_ls is an example of a relative pathname. A
special filename dot (.) refers to the directory pecified by its
predecessor in the pathname, and dot-dot (..) refers to the parent
directory of its predecessor in the pathname.
Name Server
We just saw where the objects such as groups, accounts, files, and
directories can lie within the MPE/iX directory structure. Let us now
see how we can refer to them. MPE/iX has been designed so that the
existing interfaces (such as intrinsics and CI commands) can refer to all
the objects in the directory without changing the way they refer to the
MPE objects such as files in groups. Also, POSIX interfaces such as
POSIX.1 functions and POSIX.2 commands are able to refer to MPE objects
such as accounts and groups and files within them. Conceptually, there
are three name servers: MPE, MPE-escape, and HFS.
MPE Name Server
First let us see how MPE interfaces such as intrinsics and CI commands
can refer to the objects in the directory. The familiar MPE objects
(e.g., files in groups) can be referred to by using file, file.group or
file.group.account. All such names are processed by the MPE name server.
All these names must be valid MPE names and the MPE name server upshifts
the name. When the filename is fully unqualified (say, prgfile), MPE
name server first upshifts the name to PRGFILE and refers to a file named
PRGFILE in the (CWD) which may be different from the logon group. In the
second case when the filename is, say prgfile.px, it refers to a file
named PRGFILE in the group named PX in the logon account regardless of
whether the CWD is same as the logon group or not. Finally, in the third
case when the file name is say, prgfile.px.develop, the MPE name server
refers to the file PRGFILE in group PX in account DEVELOP regardless of
where the CWD is and what the logon account is.
MPE-escape Name Server
However, if you want to refer to a file, say down_load in Figure 1, you
cannot use MPE name server because the file is not under a group. You
must somehow escape from the MPE name server to the HFS name server.
Here is how you can do that: if any name begins with a dot (.) or slash
(/), the MPE-escape name erver does not interpret the name and passes it
on to the HFS name server. So using the name, /users/jeff/bin/down_load
will do the job. Or if you change your CWD to /users/jeff, you could use
the name ./bin/down_load. Unlike HFS name server, as we will see next,
you cannot use bin/down_load as the name does not begin with either dot
or slash and hence MPE-escape name erver will not escape to the HFS name
server and may interpret the name as the file BIN with lockword DOWN_LOAD
and will give an error since DOWN_LOAD is not a valid lockword.
HFS Name Server
As we said earlier, even MPE objects such as accounts, groups, and files
under them can be refered to by the HFS name server. For naming
purposes, the accounts and groups can be treated as directories. Hence,
the file PRGFILE.PX.DEVELOP can be refered to as /DEVELOP/PX/PRGFILE. But
the HFS name server does not upshift the name, hence you cannot use the
name /develop/px/prgfile. For the HFS name server, names are always in
HFS syntax; you do not have to start the name with dot or slash. So, if
the CWD is /DEVELOP/PX/ledger, a filename main.c will not refer to the
file MAIN in group C in the logon account - it will simply refer to the
file named main.c in the CWD. (Remember that dot is a vaild HFS
character.) The HFS name erver is not yet available to the CI commands
or any intrinsic (except HPFOPEN). The name must begin with a dot or a
slash in case you want to inform the MPE-escape name server to invoke the
HFS name server.
Default Name Servers
The name server used by POSIX.1 functions and POSIX.2 commands is the HFS
name server. Most MPE intrinsics and CI commands have been modified to
use MPE-escape name server. Thus old applications/scripts will continue
to work because valid MPE names can never begin with a dot or a lash
(except the COPY command) and thus MPE-escape name server will use the
normal MPE name server. However, the user can escape to the HFS name
server by using the dot or lash character in the beginning.
Byte Stream File
With MPE/iX Release 4.5, MPE/iX has a new file type: byte stream. Byte
stream files are simply a sequence (stream) of bytes, hence the name byte
stream. They do not have any record structure associated with them. One
can build a byte stream file as follows:
BUILD filename;rec=,,B;disc=100000
Notice that you do not have to specify the record size. This is because
byte stream files have a record size of 1 byte. B means byte stream in
the same way as F means Fixed length record file. Also, since a byte
stream file is implemented with record length of one byte, disc=
parameter would indeed mean the number of bytes in the file.
So that the current applications can work currectly with byte stream, by
default intrinsics such as HPFOPEN will bind a Variable Record Emulator
type manager with a byte stream file. In such a case the byte stream
file behaves like a variable record file with the new line character
acting as the end of the record marker. If the application wants to use
the file as a byte stream file, it needs to specify option 77
(HOP_OPTION_READ_FORMAT) as 2 (HOP_READ_FORMAT_BYTE_STREAM) while calling
HPFOPEN.
Creating/Purging Hierarchical Directories
Hierarchical directories can be created by the intrinsic HPFOPEN, CI
command NEWDIR (refer to the article "New CI Commands" in this
Communicator) or by POSIX.1 and POSIX.2 interfaces.
The disk space used by hierarchical directories that are somewhere below
an MPE group (like ledger and the files main.c and Makefile), does add up
to the group and account that they are below. However, for directories
that are not below an MPE group (like users or jeff), system managers
cannot put a limit on the disk space that they can take up. However,
only users with SM capability can create a directory directly below the
root directory. Also, a new CI command DISKUSE can be used to see the
disk space used by various directories.
A hierarchical directory cannot be purged unless it is empty. A
directory is considered empty when it only has the dot (.) and dot-dot
(..) entries in it. A new CI command PURGEDIR has an option ;TREE that
will purge the files/directories under the directory recursively and
finally purge the requested directory.
MISCELLANEOUS
* With this release of MPE/iX, users with SM capability can create
files across account boundaries
* The file label will have several new fields such as file_group,
tate_chg_time, hd_link_count. Also it is possible that the
file_name field will be empty for some files because the file
names can now be 255 characters in length. Finally, the creator
field can contain a fully qualified name of the creator because
the files can now be created by users from a different account.
Trademarks
UNIX is a registered trademark of UNIX Systems Laboratories Inc. in the
USA and other countries.
MPE/iX Communicators