- remove file
#include <stdio.h> int remove(const char *path);
The remove() function causes the file or empty directory whose name is the string pointed to by path to be no longer accessible by that name. A subsequent attempt to open that file using that name will fail, unless the file is created anew.
For files, remove() is identical to unlink(). For directories, remove() is identical to rmdir().
Upon successful completion, remove() returns 0. Otherwise, it returns -1 and sets errno to indicate an error.
See attributes(5) for descriptions of the following attributes: