Expanded File Naming Syntax [ New Features of MPE/iX: Using the Hierarchical File System ] MPE/iX 5.0 Documentation
New Features of MPE/iX: Using the Hierarchical File System
Expanded File Naming Syntax
A name syntax is a set of rules that define the structure of valid names
in that syntax. MPE/iX provides an expanded file naming syntax so you
can refer to files, groups, accounts, and directories existing at all
levels within the hierarchical file system. You can still name accounts,
groups, and files by using the familiar MPE syntax. However, you'll need
to use the expanded naming syntax, the HFS syntax, to refer to files or
directories existing outside the traditional file system structure.
The following sections explain the differences between MPE syntax and HFS
syntax.
MPE syntax
MPE syntax is the familiar syntax that is defined as follows:
* The file, group, account, and lockword names may each contain up
to eight alphanumeric characters beginning with a letter. These
names are upshifted by MPE, therefore, there is no case
sensitivity.
* File names may have the form:
file[/lockword][.group[.account]][:envid]. (The brackets indicate
optional name components.)
* File names preceded with an asterisk are
backreferences to file equations and have the form:
file[/lockword][.group[.account]][:envid]. (The brackets indicate
optional name components.)
* File names preceded with a dollar sign refer to special
system-defined files.
* File, account, and group names cannot contain special characters.
The envid component in the file name specifies the remote environment and
has two valid forms:
node[.domain[.organization]]
envname[.domain[.organization]]
Each node, envname, domain, or organization name can be up to 16
characters long and can include alphanumeric characters, the underscore
(_), and the hyphen (-). The first character must be alphabetic.
NOTE You can only refer to lockwords, remote network environment
(envid), file equations, and system-defined files (for example,
$STDIN) by using the MPE syntax.
MPE pathnames.
The traditional MPE pathname describes a file as FILE.GROUP.ACCOUNT where
the file always comes first, the group always comes second, and the
account always comes last. The following example shows a fully qualified
MPE pathname for the file MYFILE:
MYFILE.PAYROLL.FINANCE
Only files in groups can be referred to using an MPE pathname. The group
and account components of the name must refer to groups and accounts and
not to hierarchical directories.
MPE name resolution.
To ensure backward compatibility, file names are interpreted according to
MPE syntax conventions and are qualified as follows:
* All characters are upshifted and treated as uppercase.
* Characters are validated against the accepted character set (A-Z,
0-9).
* File, group, and account name lengths are checked.
* Unqualified names are resolved relative to the current working
directory. (Typically, your current working directory is your
logon group so everything works as it has in the past. But, you
can now change your current working directory to a hierarchical
directory and still use MPE syntax to create, list, purge, etc.
files and directories.)
HFS syntax
HFS syntax is similar to the file naming conventions used on open
systems.
The syntax describes files by referencing the path or location leading to
the file. For example, the file name /SYS/PUB/CI in HFS syntax is the
same as CI.PUB.SYS in MPE syntax.
HFS syntax operates as follows:
* HFS file or directory names can include alphanumeric characters
(A-Z, a-z, 0-9) and the following special characters:
* dot (.)
* underscore (_)
* hyphen (-)
* File or directory names cannot begin with a hyphen (-).
* HFS syntax is case sensitive. So, HFS file or directory names can
be in uppercase, lowercase, or mixed case.
* HFS directory or file names that are directly under the root or
directly under a group or an account must be less than or equal to
16 characters.
* HFS directory or file names under HFS directories can be up to 255
characters long.
* Maximum pathname size is 1024 characters (including null
terminator).
You can refer to traditional MPE file names using HFS syntax (as well as
using MPE syntax). However, you must specify the name in uppercase. HFS
syntax does not upshift the characters. For example, if a file named
BILLING exists in the PUB group of the MKTG account (BILLING.PUB.MKTG),
you can refer to it using HFS syntax as ./BILLING if you are in the PUB
group. You can also refer to it as /MKTG/PUB/BILLING. If you refer to
the file as ./billing, MPE/iX would not locate the file.
HFS pathnames.
Files are referenced using pathnames. Pathnames consist of a list of
name components. Except for the last name component, each name component
in a valid pathname refers to a directory or symbolic link. The last
name component may name either a directory, file, or symbolic link. The
pathname's series of name components describes a path through the file
system hierarchy.
HFS pathnames differ from MPE pathnames in the following ways:
* Names are separated with forward slashes (/), rather than dots.
* The order of the file name, group name, and account name
are presented in reverse order compared to MPE syntax
(/ACCT/GROUP/FILE versus FILE.GROUP.ACCT).
* Slash (/) at the beginning of a pathname indicates the root
directory.
* Dot-slash (./) at the beginning of a pathname indicates the
current working directory (CWD). The CWD is the directory in which
you are currently working.
* Pathnames can be up to 1023 characters whereas traditional MPE
names must be less than or equal to 26 characters (names can be up
to 35 characters if a lockword is used). See Table 2-2 for CI
restrictions.
Using these conventions, the format of the MPE pathname
MYFILE.PAYROLL.FINANCE appears as follows in HFS syntax:
/FINANCE/PAYROLL/MYFILE
In this example, it is assumed that MYFILE is a file under the PAYROLL
group and FINANCE account. However, FINANCE and PAYROLL need not
necessarily be an account and a group as they must in MPE syntax. Using
HFS syntax, MYFILE could be a file under the PAYROLL HFS subdirectory,
which is under the FINANCE HFS directory, which is under the root
directory.
Absolute and relative pathnames.
Figure 2-3 presents an example using HFS pathnames. The example
illustrates HFS directories and files using names of rivers, cities, and
states.
Figure 2-3. HFS Pathname Example
Files can be referenced using either absolute or relative pathnames. An
absolute pathname begins with a forward slash (/) and is interpreted
starting from the root directory. A relative pathname is anything
without a leading slash and is interpreted starting from your current
working directory. When working in the MPE/iX shell, relative pathnames
need not begin with a dot-slash (./).
In Figure 2-3, the file St_Croix is located in the rivers subdirectory of
the WI HFS directory. You can display the St_Croix file using its
absolute pathname from anywhere on the system:
:LISTFILE /States/WI/rivers/St_Croix
If your current working directory is /States/WI, you can display the
St_Croix file using its relative pathname:
:LISTFILE ./rivers/St_Croix
Relative pathnames are interpreted with respect to your current location
on the system. For example, given the hierarchical directory structure
shown in Figure 2-3 , the above relative pathname only works if you
are in the WI directory.
MPE-Escaped syntax is used by the CI and is the default for most
intrinsics. It assumes MPE syntax, but allows the user to "escape" to
HFS syntax by starting the name with a dot (.) or a slash (/), which are
illegal first characters in MPE syntax.
Summary of MPE/iX syntax features.
Maximum lengths of pathnames, numbers of characters in a name, and
directory depth are increased as of Release 4.5 and 5.0. Table 2-1
summarizes the new limits that can be used when calling C library
functions (available through the MPE/iX Developer's Kit) or intrinsics
such as HPFOPEN.
Table 2-1. Summary of MPE/iX Programmatic Interface Limits
----------------------------------------------------------------------------------------------
| | | |
| Feature | HFS Syntax | MPE Syntax |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| Maximum directory depth | 512 (/1/2/3...) | 3 (account, group, file) |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| Maximum no. of characters in | 255 | 8 |
| a component | | |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| Maximum characters in a | 1023 | 35 |
| pathname | | |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| File location | Under any root directory, | Under a group only |
| | /, account, or group | |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| File referencing direction | Top-down (/ACCT/GRP/file) | Bottom-up (FILE.GRP.ACCT) |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| Pathname separators | Slashes (/) | Dots (.) and slashes (/) |
| | | for lockwords |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| Case sensitivity | Yes (FILE1 and file1 are | No (Lowercase automatically |
| | two different files.) | upshifts to uppercase.) |
| | | |
----------------------------------------------------------------------------------------------
Table 2-2 summarizes the primary differences between HFS and MPE
syntax as it operates in the command interpreter (CI). The CI imposes
some constraints on component and pathname lengths, and maximum directory
depth due to the length of the command buffer. (The term component
refers to a file, account, group, directory, or fileset.)
Table 2-2. Summary of MPE/iX CI Limits
-----------------------------------------------------------------------------------------------
| | | |
| Feature | HFS Syntax | MPE Syntax |
| | | |
-----------------------------------------------------------------------------------------------
| | | |
| Maximum directory | 512 (/1/2/.../512) | 3 (file, group, account) |
| depth | | |
| | | |
-----------------------------------------------------------------------------------------------
| | | |
| Maximum number of | Up to 255 for files or directories | 8 for accounts, groups, or files |
| characters in a | under HFS directories (Note: See | |
| component | Table 2-3 for more | |
| | information.) | |
| | | |
-----------------------------------------------------------------------------------------------
| | | |
| Use of MPE syntax | Initial slash (/) or dot (.) in | Lack of an initial / or . in the |
| or HFS syntax | the CI means use HFS syntax; only | CI means use MPE syntax |
| | HFS syntax is used in the MPE/iX | |
| | shell | |
| | | |
-----------------------------------------------------------------------------------------------
| | | |
| File referencing | Top-down (/ACCT/GRP/file) | Bottom-up (FILE.GRP.ACCT) |
| direction | | |
| | | |
-----------------------------------------------------------------------------------------------
| | | |
| Pathname | Slashes (/) | Dots (.) |
| separators | | |
| | | |
-----------------------------------------------------------------------------------------------
| | | |
| Case sensitivity | Yes (FILE1 and file1 are two | No (Lowercase automatically |
| | different files.) | upshifts to uppercase.) |
| | | |
-----------------------------------------------------------------------------------------------
Table 2-2. Summary of MPE/iX CI Limits (cont.)
-----------------------------------------------------------------------------------------------
| | | |
| Feature | HFS Syntax | MPE Syntax |
| | | |
-----------------------------------------------------------------------------------------------
| | | |
| File location | Under any directory, /, account, or | Under a group only |
| | group | |
| | | |
-----------------------------------------------------------------------------------------------
| | | |
| Maximum | See Table 2-3 . | 35 (8 times 4) +3 |
| characters in | | |
| pathname | | |
| | | |
-----------------------------------------------------------------------------------------------
| | | |
| Lockwords | Not allowed | Allowed. MEMO/A3 is a file named |
| | | MEMO with a lockword called A3 |
| | | |
-----------------------------------------------------------------------------------------------
| | | |
| Specifying remote | Not allowed | Remote environment specified |
| environment | | using envid |
| | | |
-----------------------------------------------------------------------------------------------
| | | |
| File equations | (1) Allowed only on right side of | Allowed on both sides of the |
| | equation; (2) Cannot backreference | equation; backreferencing done by |
| | a file using HFS syntax | preceding name with asterisk (*) |
| | | |
-----------------------------------------------------------------------------------------------
MPE/iX commands are implemented in native mode or compatibility mode.
The MPE/iX Commands Reference Manual, Volumes I & II (32650-60115)
provides this information about each command. The maximum number of
characters that each type of command can accept in a file name that is
being used as a parameter to the command differs in native mode and
compatibility mode. The maximum directory depth (/1/2/3/4...) is the
same for both modes.
Table 2-3 displays the maximum characters in a component name (such
as a file or account name) and a pathname for natvie mode and
compatibility mode commands. Refer to the MPE/iX Commands Reference
Manual, Volumes I & II (32650-60115) to learn in which mode each command
is parsed.
Table 2-3. Native Mode vs Compatibility Mode Filename Lengths
----------------------------------------------------------------------------------------------
| | | |
| Feature | Native Mode | Compatibility Mode |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| Maximum directory depth | 512 | 512 |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| Maximum characters in a | 255 | |
| component | | * 253 for relative pathnames |
| | | (e.g., ./253chars) |
| | | * 254 for absolute names (e.g., |
| | | /254chars) |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| Maximum characters in a | 279 | |
| pathname | | * 253 for relative pathnames |
| | | (e.g., ./253chars) |
| | | * 254 for absolute names (e.g., |
| | | /254chars) |
| | | |
----------------------------------------------------------------------------------------------
MPE/iX 5.0 Documentation