| << Prev | Beej's Guide to C | Next >> |
Delete a file
#include <stdio.h> int remove(const char *filename);
Removes the specified file from the filesystem. It just deletes it. Nothing magical. Simply call this function and sacrifice a small chicken and the requested file will be deleted.
Returns zero on success, and -1 on error, setting errno.
char *filename = "/home/beej/evidence.txt";
remove(filename);
remove("/disks/d/Windows/system.ini");
| << Prev | Beej's Guide to C | Next >> |