# include "../sccshead/statbuf.h"

char remove_____[] "~|^`remove.c	1.1";
/*
	remove (unlink): write permission in directories is required
	(either implicity - owner == effuid, or explicitly)
	Calls xunlink().
*/

remove(file)
char *file;
{
	register int m;
	struct Statbuf buf;
	char *d;

	d = dname(file);
	if(stat(d,&buf) == -1)
		fatal("directory `",d,"' nonexistent (213)");
	m = buf.flags;
	chmod(d,m|(IWRITE|IEXEC));
	xunlink(file);
	chmod(d,m);
}
