Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Remove Directory (RMDIR) command removes a specified directory from the system after all objects in the directory have been unlinked and the directory is no longer in use. If a directory to be removed contains objects, this command optionally unlinks all of the objects and then deletes the directory. If the user does not have the authority to unlink every object in the directory, only those objects for which the user has the authority are unlinked. When an object cannot be unlinked, the directory and all objects in the directory that cannot be unlinked are not removed.
This command is an alias for the Remove Directory (RMVDIR) command and can also be issued using the following alternative command names:
For more information about integrated file system commands, see the Integrated file system information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Restrictions:
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
DIR | Directory | Path name | Required, Positional 1 |
RMVLNK | Remove link | *NO, *YES | Optional |
Top |
Specifies the path name of the directory or a pattern to match the path name or names of directories to be removed.
The object path name can be either a simple name or a name that is qualified with the name of the directory in which the object is located. A pattern can be specified in the last part of the path name. An asterisk (*) matches any number of characters and a question mark (?) matches a single character. If the path name is qualified or contains a pattern, it must be enclosed in apostrophes.
For more information on specifying path names, refer to "Object naming rules" in the CL concepts and reference topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Top |
Specifies whether to unlink all objects in a directory or not allow the directory to be deleted if it contains objects.
Top |
The alternative command name for RMDIR is RMVDIR. The following examples use the alternative command name, but RMDIR can be replaced directly for RMVDIR in all of them.
Example 1: Removing a Directory and the Objects in that Directory
RMVDIR DIR('W') RMVLNK(*YES)
This command removes directory W after all of its objects have been unlinked. If directory W contains objects and you have the authority to unlink all of those objects, all of the objects are unlinked and directory W is removed. If you do not have authority to unlink all of the objects, only those for which you have authority are unlinked and the directory is not removed.
Top |
*ESCAPE Messages
Top |