remove
remove directory entry
You're viewing an older version of this page (#3989). View the current version.
INTERFACE
#include <stdio.h> int remove ( const char *path )
DESCRIPTION
The remove function removes the file or directory specified by \c path. \n \n If \c path specifies a directory, remove(<span class="Fn">path</span>) is the equivalent of rmdir(<span class="Fn">path</span>). Otherwise, it is the equivalent of unlink(<span class="Fn">path</span>).
The following example attempts to delete the file "fred.txt" from the current directory.
Example 1
#include <stdio.h>
int main()
{
remove("fred.txt");
return 0;
}ERRORS
The remove function may fail and set errno for any of the errors specified for the routines lstat, rmdir or unlink.