Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ rmdir(2) — HP-UX 5.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

mkdir(2)

unlink(2)

RMDIR(2)

NAME

rmdir − remove a directory file

SYNOPSIS

rmdir(path)
char *path;

HP-UX COMPATIBILITY

Level: HP-UX/STANDARD

Origin: UCB

Remarks: Not all systems implement this as a system call; some use a library call to the rmdir(1) command to achieve the same effect.  The errors documented below will appear in any case, and no error messages will ever be printed.

DESCRIPTION

Rmdir removes a directory file whose name is given by path.  The directory must be empty before it can be removed. 

RETURN VALUE

A 0 is returned if the remove succeeds; otherwise a −1 is returned and an error code is stored in the global location errno.

ERRORS

The named file is removed unless one or more of the following are true:

[ENOTEMPTY]
The named directory is not empty (it contains files named other than “.” and “..”).

[ENOENT] The pathname was too long. 

[ENOTDIR] A component of the path prefix is not a directory, or the named file is not a directory. 

[ENOENT] The named file does not exist. 

[EACCES] A component of the path prefix denies search permission. 

[EACCES] Write permission is denied on the directory containing the link to be removed. 

[EBUSY] The directory to be removed is the mount point for a mounted file system. 

[EROFS] The directory entry to be removed resides on a read-only file system. 

[EFAULT] Path points outside the process’s allocated address space. 

[ELOOP] Too many symbolic links were encountered in translating the pathname. 

[EINVAL] "." and ".." are not allowed as directory names. 

HARDWARE DEPENDENCIES

Series 500:
The directory identifiers "." and ".." are recognized by Series 500 HP-UX, but files of the same names do not appear in the directory structure.

Series 200:
An empty directory contains two files named "“.”" and "“..”", respectively ( ls -a option is used to display them). 

SEE ALSO

mkdir(2), unlink(2)

Hewlett-Packard  —  last mod. May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026