HPlogo Performing System Management Tasks: HP 3000 MPE/iX Computer Systems > Chapter 8 Allowing Access to the System

Managing Directories

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

A directory is a special kind of file that contains entries that point to other files and directories. Directories, like MPE groups, help applications and users to organize files in a logical manner on the system. A directory contained within another directory is also called a subdirectory. A directory that contains other directories is called a parent directory. Directories, subdirectories, and files form a structure for the file system. A directory ENTRY associates a file name with a file.

MPE/iX has four types of directories:

  • root directory

  • MPE groups

  • accounts

  • hierarchical directories

The overall directory structure has a common root. The root of the directory is called the parent directory. A slash (/) separates each part of a pathname. The maximum pathname length is 1023 characters. Although pathnames can be 1023 characters, other system limits restrict pathname length. For example, the command interpreter limits the number of characters you can type in a command to 511 characters.

When the pathname begins at the root directory, it is called an absolute pathname. An example of an absolute pathname is:

   /SYS/MYGRP/dir1/2file

The example describes the location of the file 2file. It is in the directory dir1, which is a subdirectory of the MYGRP group; MYGRP is in the SYS account, which is a subdirectory of the root directory (/).

An absolute pathname is similar to a fully qualified MPE file name in that the names of all the components are listed. The fully qualified MPE file name TDP.PUB.SYS translates to the absolute pathname /SYS/PUB/TDP.

Other pathnames are relative to a process's current working directory. (The current working directory is the directory where you are working.) So if you specify the name ./jvance/spook, MPE looks for a subdirectory called jvance in your current working directory, then for a file called spook in that directory.

To create directories

You can create directories in any directory, group, or account to which you have CD access. You must have the following privileges to create directories directly under an MPE group:

  • Create directory entries (CD) access for the parent directory

  • Save files (SF) capability

  • Traverse directory entries (TD) access to the parent directory

To create a directory in your current working directory, use the NEWDIR command. For example, to create a new directory called CPROGS in your current working directory, enter:

   :NEWDIR CPROGS

To create a directory in a group other than your logon group, use the full pathname of the directory in the NEWDIR command line. For example, to create a new directory called cprogs in the group called BOB in the PRG account, enter:

   :NEWDIR /PRG/BOB/cprogs

If you typed the name in lowercase and did not preface it with a ./ or /, MPE/iX converts it to uppercase. If you want to use HFS syntax for naming a directory, you need to preface the name with ./ or /. For example, to create a directory with a lowercase name, enter:

   :NEWDIR ./cprogs
NOTE: MPE group-level accounting does not extend to directories residing outside of accounts.

To control access to directories

You can use access control definitions (ACDs) to grant the following accesses to directories:

CD

- Create directory entries

DD

- Delete directory entries

RD

- Read directory entries

TD

- Traverse directory entries

RACD

- Read ACD

NONE

- No access

By default, directories allow Read ACD privilege to all users on the system (RACD:@.@). You can use the LISTFILE command to display directory ACDs. You assign or change directory ACDs using the ALTSEC command. Read the MPE/iX Commands Reference Manual, Vol. I (32650-90003) for detailed syntax and descriptions of ALTSEC and LISTFILE.

The root directory, accounts, and groups cannot be assigned ACDs. However, all users are granted access equivalent to read directory entries (RD) access and traverse directory entries (TD) access to root, all accounts, and all MPE groups.

Initially, only you as the system manager have create directory entries (CD) and delete directory entries (DD) access to root. CD and DD access are governed by the appropriate privileges. Save access for an MPE group implies CD and DD permission. A user can create or delete a directory in an MPE group if the group grants Save access to the user.

To list directories

The LISTFILE command traverses hierarchical directories and accepts pathnames. Because MPE/iX file names can be long, the output format displays any names with the HFS syntax as the last item, wrapping the ends of long file names onto the next line, if necessary.

To list only the directories that are within the current working directory, use the LISTDIR system-provided UDC. The LISTDIR UDC invokes the LISTFILE command. You can also use LISTDIR to show directories anywhere on the system:

   LISTDIR dir@

To list files in directories

Use the LISTFILE command to list files in directories. For example, to list all of the files and any directories (which are distinguished from files by a trailing slash) in the current working directory, enter:

   :listfile ./@

To list only files named using MPE syntax:

   :LISTFILE @

To delete directories

Use the PURGEDIR command to delete a hierarchical directory. You need to begin the name with (.) or (/) otherwise the name is interpreted using MPE syntax rather than HFS syntax.

You cannot use PURGEDIR to delete an account, an MPE group, the root directory, or a file. You will receive an error message if you try. Although you can specify (.) and (..) in the PURGEDIR command, you cannot delete these directories.

You must have traverse directory entries (TD) access to the directory you want to delete and any other directories referenced in the pathname. You must have delete directory entries (DD) access to the parent directory of the directory you are deleting.

NOTE: If the directory that you are trying to delete is not empty, you receive an error message and it is not deleted. Use the PURGEDIR command with the TREE option, or specify a pathname ending in /. For example:
   :purgedir /MYACCT/MYGRP/dir1 ;TREE

or

   :purgedir /MYACCT/MYGRP/dir1/

If any of the files in the directory (or directories) are open when you execute the command, you receive an IN USE warning message. All opened files and the directory path(s) to those files are not deleted. All other files and directories are deleted.

To delete directories using wildcards

You can also use wildcards to delete directories and the files or directories they contain. For example, to delete all empty directories in the current working directory with TMP in their name, enter:

   :purgedir @TMP@

Or, to delete all directories under the CWD with names beginning with TMP, and all objects below these directories, enter:

   :purgedir TMP@; TREE

To move between directories

Use the CHDIR command to move from one directory to another or to return to your logon directory.

For example, if you created a directory called memos in your logon group (ALEXB) in your account (FOX) and your current working directory is /FOX/ALEXB, you can move to it as follows:

   :chdir ./memos

The name ./memos is a relative pathname. MPE interprets it relative to the current working directory. You can move back up to the MPE group level by specifying the full pathname:

   :chdir /FOX/ALEXB

Or, if ALEXB is your logon group, simply enter CHDIR.

To Show the current working directory

MPE/iX provides a CI variable called HPCWD that keeps track of your current working directory (CWD). As you move around in the file system, it is useful to display your current location.

To find out your current working directory, showing the path from the root, enter:

   :showvar hpcwd

You can change your prompt so that it shows your current working directory at all times by including the variable in the prompt. To do so, at the MPE prompt, type:

   :setvar save_prompt hpprompt

   :setvar hpprompt "!!HPCWD:"

To list the space used by directories

Use the DISKUSE command to display the amount of disk space used by a directory. Each column contains information about the directory you're reviewing.

TREE

contains the total number of sectors used by the directory listed. This includes space used by the directory itself, all files in the directory, and all space used by subdirectories and files in the subtree below the directory.

LEVEL BELOW

shows the number of sectors allocated to all files and directories one level below the named directory. It does not include the space used by the directory itself or by the subtree.

DIRECTORY

displays the name of the directory in HFS format (for example, /MYACCT/MYGROUP).

Sometimes the number of sectors under the TREE column are followed by a plus sign. This means that the amount refers to directories that are one level below the target directory.

You can also report the disk space used by a directory and all subtrees below it. If you specify a directory ending with a / and use HFS syntax or use the TREE option, the command reports the amount of space used by it and all directories in it.

NOTE: The REPORT command does not provide detailed line items for directories below groups. It shows groups below accounts but not any directories below accounts.
Feedback to webmaster