The rmdir callable service removes a directory. The directory must be empty.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1RMD): | 31-bit |
AMODE (BPX4RMD): | 64-bit |
ASC mode: | Primary mode |
Interrupt status: | Enabled for interrupts |
Locks: | Unlocked |
Control parameters: | All parameters must be addressable by the caller and in the primary address space. |
|
AMODE 64 callers use BPX4RMD with the same parameters.
The name of a fullword that contains the length of Directory_name.
The name of a field that contains the pathname of the directory to be removed. The length of this field is specified in Directory_name_length.
The name of a fullword in which the rmdir service returns 0 if the request is successful, or -1 if it is not successful.
Return_code | Explanation |
---|---|
EACCES | One of the following conditions occurred:
|
EBUSY | The directory cannot be removed, because it is being used by a process. The following reason code can accompany the return code: JRRootNode. |
EINVAL | The argument that was supplied was incorrect. Examples of incorrect arguments are dot and dot-dot. The following reason code can accompany the return code: JRDotOrDotDot. |
ELOOP | A loop exists in symbolic links that were encountered during resolution of the Directory_name argument. This error is issued if more than 24 symbolic links are detected in the resolution of Directory_name. |
ENAMETOOLONG | The name of the directory is longer than 1023 characters; or some component of the pathname is longer than 255 characters. This could be as a result of encountering a symbolic link during resolution of Directory_name, where the substituted string is longer than 1023 characters. |
ENOENT | The directory that was specified by Directory_name was not found; or no Directory_name parameter was specified. The following reason code can accompany the return code: JRFileNotThere. |
ENOTDIR | Some component of Directory_name is not a directory. The following reason code can accompany the return code: JRPathNotDir. |
ENOTEMPTY | The directory contains files or subdirectories. |
EROFS | The directory that is to be removed is on a read-only file system. The following reason code can accompany the return code: JRReadOnlyFS. |
The name of a fullword in which the rmdir service stores the reason code. The rmdir service returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. For the reason codes, see z/OS UNIX System Services Messages and Codes.
There are no restrictions on the use of the rmdir service.
For an example using this callable service, see BPX1RMD (rmdir) example.