The GNU C Library - Deleting Files Go to the first , previous , next , last section, table of contents . Deleting Files You can delete a file with the functions unlink or remove .
Deletion actually deletes a file name.
If this is the file's only name, then the file is deleted as well. The unlink function deletes the file name filename . If this is a file's sole name, the file itself is also deleted. This function returns 0 on successful completion, and -1 on error. This error indicates that the file is being used by the system in such a way that it can't be unlinked.