man-pages/man2/rmdir.2.html
2021-03-31 01:06:50 +01:00

221 lines
4.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of RMDIR</TITLE>
</HEAD><BODY>
<H1>RMDIR</H1>
Section: Linux Programmer's Manual (2)<BR>Updated: 2015-08-08<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
rmdir - delete a directory
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>#include &lt;<A HREF="file:///usr/include/unistd.h">unistd.h</A>&gt;</B>
<P>
<B>int rmdir(const char *</B><I>pathname</I><B>);</B>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>rmdir</B>()
deletes a directory, which must be empty.
<A NAME="lbAE">&nbsp;</A>
<H2>RETURN VALUE</H2>
On success, zero is returned.
On error, -1 is returned, and
<I>errno</I>
is set appropriately.
<A NAME="lbAF">&nbsp;</A>
<H2>ERRORS</H2>
<DL COMPACT>
<DT id="1"><B>EACCES</B>
<DD>
Write access to the directory containing
<I>pathname</I>
was not allowed, or one of the directories in the path prefix of
<I>pathname</I>
did not allow search permission.
(See also
<B><A HREF="/cgi-bin/man/man2html?7+path_resolution">path_resolution</A></B>(7).
<DT id="2"><B>EBUSY</B>
<DD>
<I>pathname</I>
is currently in use by the system or some process that prevents its
removal.
On Linux, this means
<I>pathname</I>
is currently used as a mount point
or is the root directory of the calling process.
<DT id="3"><B>EFAULT</B>
<DD>
<I>pathname</I> points outside your accessible address space.
<DT id="4"><B>EINVAL</B>
<DD>
<I>pathname</I>
has
<I>.</I>
as last component.
<DT id="5"><B>ELOOP</B>
<DD>
Too many symbolic links were encountered in resolving
<I>pathname</I>.
<DT id="6"><B>ENAMETOOLONG</B>
<DD>
<I>pathname</I> was too long.
<DT id="7"><B>ENOENT</B>
<DD>
A directory component in
<I>pathname</I>
does not exist or is a dangling symbolic link.
<DT id="8"><B>ENOMEM</B>
<DD>
Insufficient kernel memory was available.
<DT id="9"><B>ENOTDIR</B>
<DD>
<I>pathname</I>,
or a component used as a directory in
<I>pathname</I>,
is not, in fact, a directory.
<DT id="10"><B>ENOTEMPTY</B>
<DD>
<I>pathname</I>
contains entries other than
<I>.</I> and <I>..</I> ;
or,
<I>pathname</I>
has
<I>..</I>
as its final component.
POSIX.1 also allows
<B>EEXIST</B>
for this condition.
<DT id="11"><B>EPERM</B>
<DD>
The directory containing
<I>pathname</I>
has the sticky bit
(<B>S_ISVTX</B>)
set and the process's effective user ID is neither the user ID
of the file to be deleted nor that of the directory containing it,
and the process is not privileged (Linux: does not have the
<B>CAP_FOWNER</B>
capability).
<DT id="12"><B>EPERM</B>
<DD>
The filesystem containing
<I>pathname</I>
does not support the removal of directories.
<DT id="13"><B>EROFS</B>
<DD>
<I>pathname</I>
refers to a directory on a read-only filesystem.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>CONFORMING TO</H2>
POSIX.1-2001, POSIX.1-2008, SVr4, 4.3BSD.
<A NAME="lbAH">&nbsp;</A>
<H2>BUGS</H2>
Infelicities in the protocol underlying NFS can cause the unexpected
disappearance of directories which are still being used.
<A NAME="lbAI">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?1+rm">rm</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+rmdir">rmdir</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?2+chdir">chdir</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+chmod">chmod</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+mkdir">mkdir</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+rename">rename</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+unlink">unlink</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+unlinkat">unlinkat</A></B>(2)
<A NAME="lbAJ">&nbsp;</A>
<H2>COLOPHON</H2>
This page is part of release 5.05 of the Linux
<I>man-pages</I>
project.
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="14"><A HREF="#lbAB">NAME</A><DD>
<DT id="15"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="16"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="17"><A HREF="#lbAE">RETURN VALUE</A><DD>
<DT id="18"><A HREF="#lbAF">ERRORS</A><DD>
<DT id="19"><A HREF="#lbAG">CONFORMING TO</A><DD>
<DT id="20"><A HREF="#lbAH">BUGS</A><DD>
<DT id="21"><A HREF="#lbAI">SEE ALSO</A><DD>
<DT id="22"><A HREF="#lbAJ">COLOPHON</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:34 GMT, March 31, 2021
</BODY>
</HTML>