New Features of MPE/iX: Using the Hierarchical File System: 300 MPE/iX Computer Systems > Chapter 2 What's New: OverviewExpanded 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 is the familiar syntax that is defined as follows:
The envid component in the file name specifies the remote environment and has two valid forms:
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.
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:
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. To ensure backward compatibility, file names are interpreted according to MPE syntax conventions and are qualified as follows:
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:
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. 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:
Using these conventions, the format of the MPE pathname MYFILE.PAYROLL.FINANCE appears as follows in HFS syntax:
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. Figure 2-3 “HFS Pathname Example” presents an example using HFS pathnames. The example illustrates HFS directories and files using names of rivers, cities, and states. 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:
If your current working directory is /States/WI, you can display the St_Croix file using its relative pathname:
Relative pathnames are interpreted with respect to your current location on the system. For example, given the hierarchical directory structure shown in Figure 2-1 “MPE/iX File System (Prior to Release 4.5)”, 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. 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 “Summary of MPE/iX Programmatic Interface Limits” 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
Table 2-2 “Summary of MPE/iX CI Limits” 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
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 “Native Mode vs Compatibility Mode Filename Lengths” 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
|