Call the unlink() function to delete a file
unlink file
The unlink utility is a command-line interface to the unlink() function:
(void)unlink( file );
Only the superuser may use the unlink utility. Only the superuser may unlink a directory, and then only if the filesystem allows it (see _PC_LINK_DIR in the description of pathconf() in the Library Reference).
The unlink command can be very dangerous to your filesystem; you should probably use rm or rmdir instead.
pathconf() in the Library Reference