remove
Remove directory entry
Description
The remove function removes the file or directory specified bypath
.
If path
specifies a directory, remove(path) is the equivalent of rmdir(path). Otherwise, it is the equivalent of unlink(path).
The following example attempts to delete the file "fred.txt" from the current directory.
Example:
Example - Remove directory entry
Workings
#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.See Also
reference:systemLast Modified: 18 Dec 11 @ 13:13 Page Rendered: 2022-03-14 17:28:07