|
|
MPE/iX Commands Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 6 Command Definitions P-RPURGEDIR |
|
Purges (unlinks) one or more directories. PURGEDIR [dir=] dir_name
You can issue the PURGEDIR command from a job, a session, a program, or in BREAK. Pressing Break terminates execution of this command. You must have TD access to each component in the dir_name pathname, and DD permission to the parent directory of dir_name. (Refer to the ALTSEC command for more information on directory access.) If wildcards are specified with dir_name, then RD access is required to the parent directory of each wildcard component. If the purge is multilevel, then TD, RD and DD accesses are necessary to each directory below dir_name. The PURGEDIR command purges the directory dir_name. The dir_name cannot name an MPE account, an MPE group, a file, or root (/). Dot (.) and dot-dot (..) can be specified but cannot be purged. By default PURGEDIR deletes an MPE-named directory. This means that dir_name must follow all MPE naming rules, unless it is prefixed with a dot (.) or a slash (/). Since the MPE name syntax defines three levels, fully (or partially) qualified MPE-named directories can only be created under MPE groups. Unqualified MPE-named directories are created relative to the CWD. Directories do not support lockwords, file equations, or system defined file names (for example, $NEWPASS). If dir_name begins with a dot (.) or a slash (/), then HFS naming rules are enforced. The directory referenced by dir_name must be empty (except for dot (.) and dot-dot (..)) in order to be purged, unless a TREE purge is requested. A TREE purge may be requested as follows:
The dir_name parameter cannot reference root (/) because purging root is undesirable, and most likely is not what is intended. A file or directory is not deleted if it is being accessed (opened); however, all non-accessed objects under dir_name are still purged. A final "IN USE" error indicates that dir_name was not deleted because one or more children objects could not be removed. If CONFIRM is specified while your session is interactive, and it is legal for you to purge dir_name, then you are prompted to confirm the purge of dir_name. If a NOTREE purge is requested, the following prompt is displayed:
Valid responses are YES, Y, NO, and N (case insensitive). If a TREE purge is requested, the prompt is:
Valid responses are ALL, NO, and N (case insensitive).
The SHOW option displays the name of each purged file and directory on $STDLIST. For example:
The SHOWERRORS option displays any error that prevents an object from being deleted on $STDLIST after the object name is displayed. Object names are only displayed if an error occurs. The following examples purge dir1, which is empty.
The following examples purge dir1 and all objects below dir1.
The next example shows the command to purge MYDIR.
The next example shows the command to purge MYDIR and all objects below.
The next example illustrates the SHOW and TREE options.
The following command purges all empty directories under the CWD with TMP in their name.
The following command purges all directories under the CWD with names beginning with TMP, and all objects below these directories.
The following command purges all directories under the CWD with names ending with tmp, and all objects below these directories.
The following command purges all empty directories rooted to /a/b.
The following command purges all directories rooted to CWD/a@/b@ and all objects below these directories.
You can use the PURGEDIR command to delete a directory and the files or directories it contains using wildcards. For example, to delete all directories rooted to MYACCT/MYGRP enter:
To delete all empty directories under the CWD (Current Working Directory) with TMP in their name:
To delete all directories under the CWD with names beginning with TMP all objects below these directories:
To delete all directories under the CWD with names ending with TMP all objects below these directories:
When wildcards are specified with dir_name, then RD access is required to the parent directory of each wildcard component. If the purge is multilevel, then TD, RD, and DD accesses are necessary to each directory below dir_name. |
|