diff options
author | Rob Landley <rob@landley.net> | 2007-12-20 06:30:19 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2007-12-20 06:30:19 -0600 |
commit | e745d8e00eac61c91a540cd75d277cfc41606ce1 (patch) | |
tree | 21cda5d430ae1d0e953818dba378c001cc0bcc41 /lib | |
parent | da09b7ff7e305b9a4f82e0048d1c4cc0a8565b64 (diff) | |
download | toybox-e745d8e00eac61c91a540cd75d277cfc41606ce1.tar.gz |
Upgrade patch to understand creating and deleting files.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lib.c | 6 | ||||
-rw-r--r-- | lib/lib.h | 1 |
2 files changed, 7 insertions, 0 deletions
@@ -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) { @@ -60,6 +60,7 @@ void xputc(char c); void xflush(void); void xexec(char **argv); void xaccess(char *path, int flags); +void xunlink(char *path); int xcreate(char *path, int flags, int mode); int xopen(char *path, int flags); void xclose(int fd); |