HPlogo MPE/iX Developer's Kit Reference Manual Volume I: HP 3000 MPE/iX Computer Systems > Chapter 3  MPE/iX Library Implementation Considerations

Directories

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

This section provides an overview of implementation considerations that you must understand when creating and managing MPE/iX directories through the POSIX/iX library. For more information about how directories are created and managed in a POSIX.1 environment, refer to chapter 3, "Files and Directories", in The POSIX.1 Standard - A Programmer's Guide (36430-90003).

Additional information about MPE/iX directories is located in New Features of MPE/iX: Using the Hierarchical File System (32650-90351).

MPE/iX Directories

Beginning with MPE/iX Release 4.5, the directory structure of MPE/iX has been enhanced with the introduction of the MPE/iX hierarchical file system (HFS) directory structure. This has been accomplished by integrating the POSIX.1 hierarchical directory structure within the "classic" MPE directory structure, providing the benefits of both directory structures to existing and new users.

MPE/iX HFS directory services present an integrated view of the file system. Files and hierarchical directories can be created anywhere in the file system.

MPE/iX accounts and MPE/iX groups are special directories that serve as directories while continuing to serve as "classic" MPE accounts and groups.

POSIX/iX directory functions can access any file in the file system hierarchy, including files in the "classic" MPE directory structure, using HFS syntax. For example, both of the following fully qualified file name specifications refer to the same file.

   /MYACCT/MYGROUP/MYFILE



   MYFILE.MYGROUP.MYACCT

MPE/iX Directory Features

The following sections describe special features of the MPE/iX root directory, MPE/iX accounts and MPE/iX groups, hierarchical directories, and the dot (.) and dot dot (..) directories. You need to understand these special features in order to create and manage directories through POSIX/iX library functions.

Root Directory Features

  • The MPE/iX root directory (.) cannot be renamed, copied, or purged.

  • Only users with SM capability can create objects directly under the root directory.

  • Access permissions for the root directory are read and execute access for all users and write access for none. Attempts to use the chmod() function to remove or change access permissions of the root directory result in an error, with errno set to EINVAL.

  • Names of files and hierarchical directories created directly under the root directory are restricted to 16 characters in length.

  • The root directory is restricted to the MPE/iX system volume set.

  • The root directory does not contain explicit dot (.) and dot dot (..) directories; however, dot (.) and dot dot (..) directory behavior is supported. The dot (.) and dot dot (..) directories can be opened just like any other hierarchical directory. File information functions can be used to return information about these directories.

MPE/iX Account Features

  • MPE/iX accounts cannot be created, renamed, copied, or purged through POSIX/iX library functions. MPE/iX accounts can be created directly under the root directory only by a user with SM capability using the MPE/iX CI command NEWACCT.

  • Access permissions for an MPE/iX account are read and execute access for all users and write access for none. Attempts to use the chmod() function to remove or change access permissions of an MPE/iX account result in an error, with errno set to EINVAL.

  • When an MPE/iX account name is a component in a pathname, it must be specified in uppercase.

  • MPE/iX accounts are restricted to the MPE/iX system volume set.

  • An MPE/iX account does not contain explicit dot (.) and dot dot (..) directories; however, dot (.) and dot dot (..) directory behavior is supported. The dot (.) and dot dot (..) directories can be opened just like any other hierarchical directory. File information functions can be used to return information about these directories.

  • The user ID (UID) and group ID (GID) associated with an MPE/iX account cannot be modified through POSIX/iX library functions.

MPE/iX Group Features

  • MPE/iX groups cannot be created, renamed, copied, or purged through POSIX/iX library functions. MPE/iX groups can be created directly under MPE/iX accounts only by a user with SM capability or a user with AM capability who is a member of that account (whose GID matches the GID of the account). MPE/iX groups are created by MPE/iX CI command NEWGROUP and modified by the MPE/iX CI command ALTGROUP.

  • Default access permissions for MPE/iX groups are read and execute access for all users and write access for none. Attempts to use the chmod() function to remove or change access permissions of an MPE/iX group result in an error, with errno set to EINVAL.

  • When an MPE/iX group name is a component in a pathname, it must be specified in uppercase.

  • Files and hierarchical directories can be created at any level beneath MPE/iX groups.

  • Names of files and hierarchical directories created directly under MPE/iX groups are restricted to 16 characters in length.

  • MPE/iX groups (and, indirectly, all files and hierarchical directories at all levels under them) can optionally be assigned to a user volume set.

  • MPE/iX accounting limits for disk space apply to both hierarchical directories and files located at all levels under MPE/iX groups.

  • An MPE/iX group does not contain explicit dot (.) and dot dot (..) directories; however, dot (.) and dot dot (..) directory behavior is supported. The dot (.) and dot dot (..) directories can be opened just like any other hierarchical directory. File information functions can be used to return information about these directories.

  • The user ID (UID) and group ID (GID) associated with an MPE/iX group cannot be modified through POSIX/iX library functions.

  • An MPE/iX group must have MPE/iX save access assigned to it before files and hierarchical directories can be created at any level under it.

Hierarchical Directory Features

  • Hierarchical directories cannot be renamed through POSIX/iX library functions.

  • Users can define and modify access permissions for hierarchical directories through POSIX/iX library functions.

  • The group ID (GID) of a hierarchical directory is inherited from its parent directory. The user ID (UID) of a hierarchical directory is inherited from the effective UID of the process that created it. The UID and GID of a hierarchical directory can be modified using the chown() function.

  • Hierarchical directories (and all objects under them) that are not under MPE/iX accounts and MPE/iX groups are restricted to the MPE/iX system volume set.

  • Names of hierarchical directories and files located directly under either the root directory or MPE/iX groups are restricted to 16 characters in length.

  • Names of hierarchical directories that are not directly under either the root directory or MPE/iX groups are restricted to 255 characters in length. This limit is defined by {NAME_MAX}, found in the header <limits.h>.

  • Hierarchical directories contain explicit dot (.) and dot dot (..) directory entries.

Dot and Dot Dot Directory Features

When a hierarchical directory is first created by the mkdir() function, two special directory entries are placed in the hierarchical directory:

  • The dot (.) directory entry is an alternative way to specify a current directory without having to use a formal directory name.

  • The dot dot (..) directory is an alternative way to specify a current directory's parent directory without having to use a formal directory name.

The dot (.) and dot dot (..) directories provide additional navigation aids to a process. Applications using the dot (.) and dot dot (..) directories to express current directory or parent directory need not be concerned with their absolute location on the system. The use of these directory names in pathname resolution increases the portability of applications to any location in a file system.

The dot (.) and dot dot (..) directories can be opened just like any other hierarchical directory. File information functions can be used to return information about these directories.

These two directories cannot be explicitly purged from their parent directory except by purging the parent directory. For example, an attempt to use rmdir() to purge the dot (.) or dot dot (..) directory results in an error, with errno set to EIMPL.

NOTE: The dot (.) and dot dot (..) directories are not found explicitly under the root directory or under MPE/iX accounts and MPE/iX groups; however, dot (.) and dot dot (..) behavior is supported.

Additional Implementation Considerations

The return type of the rewinddir() function is implemented as int in order to return a value of -1 indicating an error. The POSIX.1 standard calls for no value to be returned (void). A strictly conforming POSIX.1 application should not evaluate values returned by rewinddir().

If an entry is purged from or added to a directory after the most recent call to opendir() or rewinddir(), subsequent returns from readdir() accurately reflect the current state of the directory.

The unlink() function cannot be used to purge hierarchical directories. Instead, use rmdir() to purge hierarchical directories.

Feedback to webmaster