[9] | 1 | .\" Copyright (c) 1983 Regents of the University of California.
|
---|
| 2 | .\" All rights reserved. The Berkeley software License Agreement
|
---|
| 3 | .\" specifies the terms and conditions for redistribution.
|
---|
| 4 | .\"
|
---|
| 5 | .\" @(#)rmdir.2 6.3 (Berkeley) 8/26/85
|
---|
| 6 | .\"
|
---|
| 7 | .TH RMDIR 2 "August 26, 1985"
|
---|
| 8 | .UC 5
|
---|
| 9 | .SH NAME
|
---|
| 10 | rmdir \- remove a directory file
|
---|
| 11 | .SH SYNOPSIS
|
---|
| 12 | .nf
|
---|
| 13 | .ft B
|
---|
| 14 | #include <unistd.h>
|
---|
| 15 |
|
---|
| 16 | int rmdir(const char *\fIpath\fP)
|
---|
| 17 | .fi
|
---|
| 18 | .ft R
|
---|
| 19 | .SH DESCRIPTION
|
---|
| 20 | .B Rmdir
|
---|
| 21 | removes a directory file
|
---|
| 22 | whose name is given by
|
---|
| 23 | .I path.
|
---|
| 24 | The directory must not have any entries other
|
---|
| 25 | than \*(lq.\*(rq and \*(lq..\*(rq.
|
---|
| 26 | .SH "RETURN VALUE
|
---|
| 27 | A 0 is returned if the remove succeeds; otherwise a \-1 is
|
---|
| 28 | returned and an error code is stored in the global location \fIerrno\fP\|.
|
---|
| 29 | .SH ERRORS
|
---|
| 30 | The named file is removed unless one or more of the
|
---|
| 31 | following are true:
|
---|
| 32 | .TP 15
|
---|
| 33 | [ENOTDIR]
|
---|
| 34 | A component of the path is not a directory.
|
---|
| 35 | .TP 15
|
---|
| 36 | [ENAMETOOLONG]
|
---|
| 37 | The path name exceeds PATH_MAX characters.
|
---|
| 38 | .TP 15
|
---|
| 39 | [ENOENT]
|
---|
| 40 | The named directory does not exist.
|
---|
| 41 | .TP 15
|
---|
| 42 | [ELOOP]
|
---|
| 43 | Too many symbolic links were encountered in translating the pathname.
|
---|
| 44 | (Minix-vmd)
|
---|
| 45 | .TP 15
|
---|
| 46 | [ENOTEMPTY]
|
---|
| 47 | The named directory contains files other than ``.'' and ``..'' in it.
|
---|
| 48 | .TP 15
|
---|
| 49 | [EACCES]
|
---|
| 50 | Search permission is denied for a component of the path prefix.
|
---|
| 51 | .TP 15
|
---|
| 52 | [EACCES]
|
---|
| 53 | Write permission is denied on the directory containing the link
|
---|
| 54 | to be removed.
|
---|
| 55 | .TP 15
|
---|
| 56 | [EPERM]
|
---|
| 57 | The directory containing the directory to be removed is marked sticky,
|
---|
| 58 | and neither the containing directory nor the directory to be removed
|
---|
| 59 | are owned by the effective user ID.
|
---|
| 60 | .TP 15
|
---|
| 61 | [EBUSY]
|
---|
| 62 | The directory to be removed is the mount point
|
---|
| 63 | for a mounted file system.
|
---|
| 64 | .TP 15
|
---|
| 65 | [EIO]
|
---|
| 66 | An I/O error occurred while deleting the directory entry
|
---|
| 67 | or deallocating the inode.
|
---|
| 68 | .TP 15
|
---|
| 69 | [EROFS]
|
---|
| 70 | The directory entry to be removed resides on a read-only file system.
|
---|
| 71 | .TP 15
|
---|
| 72 | [EFAULT]
|
---|
| 73 | .I Path
|
---|
| 74 | points outside the process's allocated address space.
|
---|
| 75 | .SH "SEE ALSO"
|
---|
| 76 | .BR mkdir (2),
|
---|
| 77 | .BR unlink (2).
|
---|