Google
 

Trailing-Edge - PDP-10 Archives - SRI_NIC_PERM_FS_1_19910112 - kcc-6/lib/stdio/remove.c
There are 5 other files named remove.c in the archive. Click here to see a list.
/*
 *	REMOVE - remove or delete a file (CARM 2, sec 17.15)
 *
 *	(c) Copyright Ken Harrenstien, SRI International 1987
 *
 *	Returns 0 if succeeded or file didn't exist, non-zero otherwise.
 */

#include <errno.h>

extern int unlink();	/* Syscall */

int
remove(filename)
char *filename;
{
    int res;
    if ((res = unlink(filename)) == 0	/* If delete won, */
      || errno == ENOENT)		/* or failed cuz file not there */
	return 0;			/* then return Success */
    return res;			/* else return whatever failure value was */
}