CINXE.COM

remove

<html> <head> <title>remove</title> <META NAME="KEYWORDS" CONTENT="remove"> </head> <body BGCOLOR="#ffffff" LINK="#0000ff" VLINK="#0000ff" ALINK="#0000ff" TEXT="#000000"> <center> <h1><b>remove</b></h1></center> <PRE> <STRONG><A HREF="/man3/REMOVE">REMOVE(3)</A></STRONG> Linux Programmer's Manual <STRONG><A HREF="/man3/REMOVE">REMOVE(3)</A></STRONG> NAME remove - remove a file or directory SYNOPSIS #include &lt;stdio.h&gt; int remove(const char *pathname); DESCRIPTION remove() deletes a name from the filesystem. It calls <STRONG><A HREF="/man2/unlink">unlink(2)</A></STRONG> for files, and <STRONG><A HREF="/man2/rmdir">rmdir(2)</A></STRONG> for directories. If the removed name was the last link to a file and no processes have the file open, the file is deleted and the space it was using is made available for reuse. If the name was the last link to a file, but any processes still have the file open, the file will remain in existence until the last file descriptor referring to it is closed. If the name referred to a symbolic link, the link is removed. If the name referred to a socket, FIFO, or device, the name is removed, but processes which have the object open may continue to use it. RETURN VALUE On success, zero is returned. On error, -1 is returned, and errno is set appropriately. ERRORS The errors that occur are those for <STRONG><A HREF="/man2/unlink">unlink(2)</A></STRONG> and <STRONG><A HREF="/man2/rmdir">rmdir(2)</A></STRONG>. ATTRIBUTES For an explanation of the terms used in this section, see at- <STRONG><A HREF="/man7/tributes">tributes(7)</A></STRONG>. +----------+---------------+---------+ |Interface | Attribute | Value | +----------+---------------+---------+ |remove() | Thread safety | MT-Safe | +----------+---------------+---------+ CONFORMING TO POSIX.1-2001, POSIX.1-2008, C89, C99, 4.3BSD. BUGS Infelicities in the protocol underlying NFS can cause the unexpected disappearance of files which are still being used. SEE ALSO <STRONG><A HREF="/man1/rm">rm(1)</A></STRONG>, <STRONG><A HREF="/man1/unlink">unlink(1)</A></STRONG>, <STRONG><A HREF="/man2/link">link(2)</A></STRONG>, <STRONG><A HREF="/man2/mknod">mknod(2)</A></STRONG>, <STRONG><A HREF="/man2/open">open(2)</A></STRONG>, <STRONG><A HREF="/man2/rename">rename(2)</A></STRONG>, <STRONG><A HREF="/man2/rmdir">rmdir(2)</A></STRONG>, un- <STRONG><A HREF="/man2/link">link(2)</A></STRONG>, <STRONG><A HREF="/man3/mkfifo">mkfifo(3)</A></STRONG>, <STRONG><A HREF="/man7/symlink">symlink(7)</A></STRONG> COLOPHON This page is part of release 5.05 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. GNU 2017-09-15 <STRONG><A HREF="/man3/REMOVE">REMOVE(3)</A></STRONG></PRE> <center> <h6>Man Pages Copyright Respective Owners. Site Copyright (C) 1994 - 2025 <a href="http://www.he.net">Hurricane Electric</a>. All Rights Reserved.</h6></center> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10