From e745d8e00eac61c91a540cd75d277cfc41606ce1 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 20 Dec 2007 06:30:19 -0600 Subject: Upgrade patch to understand creating and deleting files. --- lib/lib.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/lib.c') diff --git a/lib/lib.c b/lib/lib.c index 510b830b..985c580d 100644 --- a/lib/lib.c +++ b/lib/lib.c @@ -178,6 +178,12 @@ void xaccess(char *path, int flags) if (access(path, flags)) perror_exit("Can't access '%s'\n", path); } +// Die unless we can delete a file. (File must exist to be deleted.) +void xunlink(char *path) +{ + if (unlink(path)) perror_exit("unlink '%s'", path); +} + // Die unless we can open/create a file, returning file descriptor. int xcreate(char *path, int flags, int mode) { -- cgit v1.2.3